/* =================================================================
   main.css — CEFR Learning Platform Design System
   Colegio Reggio Emilia, Envigado, Colombia
   "Un mundo por descubrir"
   ================================================================= */

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

/* -----------------------------------------------------------------
   Custom Properties
   ----------------------------------------------------------------- */
:root {
  /* Brand colors */
  --blue:         #1A5276;
  --blue-light:   #2980B9;
  --blue-dark:    #154360;
  --green:        #1E8449;
  --green-light:  #27AE60;
  --orange:       #E67E22;
  --orange-light: #F39C12;
  --orange-bg:    #FEF3E7;

  /* Surfaces */
  --bg:        #F4F6F8;
  --surface:   #FFFFFF;
  --surface-2: #F8FAFC;

  /* Text */
  --text-primary:   #1A2332;
  --text-secondary: #5D6D7E;
  --text-muted:     #99A3AD;

  /* Borders & shadows */
  --border:     #DDE2E8;
  --border-focus: #2980B9;
  --shadow-sm:  0 2px 8px rgba(26,83,118,0.08);
  --shadow-md:  0 4px 20px rgba(26,83,118,0.12);
  --shadow-lg:  0 8px 40px rgba(26,83,118,0.16);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Transitions */
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* -----------------------------------------------------------------
   App Header
   ----------------------------------------------------------------- */
.app-header {
  background: linear-gradient(135deg, var(--blue) 0%, #1a6b40 100%);
  color: white;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(26,83,118,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.school-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: white;
}

.school-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
  font-style: italic;
}

.header-student {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}

.grade-badge {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.btn-logout {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.65);
}

/* -----------------------------------------------------------------
   Shared Student Navigation
   ----------------------------------------------------------------- */
.student-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.student-nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.student-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.65);
}
.student-nav a.nav-active {
  /* Hide the current page's own nav link — the page content already tells
     the student where they are, and hiding this link keeps the remaining
     three links visible without horizontal overflow on mobile. */
  display: none;
}

/* -----------------------------------------------------------------
   Roadmap Page
   ----------------------------------------------------------------- */
.roadmap-page { background: var(--bg); }

.roadmap-main {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.student-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.student-shell-main {
  width: 100%;
  margin: 0;
  padding: 0;
}
.student-sidebar {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.student-sidebar-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.student-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.student-sidebar-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}
.student-sidebar-link:hover,
.student-sidebar-link:focus-visible {
  background: var(--surface-2);
  color: var(--blue);
  outline: none;
}
.student-sidebar-link.is-active {
  background: #eaf4fb;
  color: var(--blue-dark);
}
@media (max-width: 860px) {
  .student-shell {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 48px;
    gap: 16px;
  }
  .student-sidebar {
    position: static;
    width: 100%;
    padding: 12px;
  }
  .student-sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .student-sidebar-link {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
    font-size: 0.86rem;
  }
  .student-sidebar-title { margin-bottom: 8px; }
}

/* Hero: A1 → A2 display */
.roadmap-hero {
  text-align: center;
  margin-bottom: 40px;
  padding: 36px 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.roadmap-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
}

.cefr-journey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.cefr-current {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  letter-spacing: -0.02em;
}

.cefr-arrow {
  font-size: 2rem;
  color: var(--orange);
  font-weight: 700;
  opacity: 0.85;
}

.cefr-target {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  letter-spacing: -0.02em;
}

.term-info {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* Two-column grid */
.roadmap-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .roadmap-grid { grid-template-columns: 1fr; }
  .roadmap-hero { padding: 28px 16px; }
  .cefr-current, .cefr-target { font-size: 2.8rem; }
  .roadmap-main { padding: 24px 16px 48px; }

  /* Header: wrap to two rows so logout stays reachable on phones */
  .app-header {
    padding: 10px 12px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px 12px;
    row-gap: 8px;
  }
  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .school-name {
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .school-tagline {
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-student {
    flex: 0 0 auto;
    gap: 8px;
    font-size: 0.8rem;
  }
  .header-student .grade-badge { display: none; }
  .btn-logout {
    flex-shrink: 0;
    min-height: 32px;
    padding: 6px 12px;
  }
  .student-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .student-nav::-webkit-scrollbar { display: none; }
  .student-nav a {
    padding: 6px 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .school-tagline { display: none; }
  .header-student #studentName {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Column headings */
.weeks-column h2,
.skills-column h2 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* -----------------------------------------------------------------
   Week Items
   ----------------------------------------------------------------- */
.weeks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  transition: all var(--transition);
  animation: slideIn 0.3s ease both;
}

.week-item:nth-child(1)  { animation-delay: 0.05s; }
.week-item:nth-child(2)  { animation-delay: 0.08s; }
.week-item:nth-child(3)  { animation-delay: 0.11s; }
.week-item:nth-child(4)  { animation-delay: 0.14s; }
.week-item:nth-child(5)  { animation-delay: 0.17s; }
.week-item:nth-child(6)  { animation-delay: 0.20s; }
.week-item:nth-child(7)  { animation-delay: 0.23s; }
.week-item:nth-child(8)  { animation-delay: 0.26s; }
.week-item:nth-child(9)  { animation-delay: 0.29s; }
.week-item:nth-child(10) { animation-delay: 0.32s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.week-complete {
  border-left-color: var(--green);
}
.week-current {
  border-left-color: var(--orange);
  background: var(--orange-bg);
  border-color: rgba(230,126,34,0.2);
  box-shadow: var(--shadow-sm);
}
.week-skipped {
  border-left-color: #BDC3C7;
  opacity: 0.75;
}
.week-locked {
  border-left-color: #E8EAED;
  opacity: 0.55;
}
.week-locked .week-title { color: var(--text-muted); }

.week-icon { font-size: 1.15rem; flex-shrink: 0; }

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

.week-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-current .week-title { color: var(--blue-dark); }

.week-focus {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quiz lock hint rendered under the focus line when the current-week quiz
   is gated on engagement criteria. Small, muted, italic. */
.week-quiz-hint {
  font-size: 0.72rem;
  color: #92400e;
  margin-top: 4px;
  font-style: italic;
  line-height: 1.3;
  white-space: normal;
}

.btn-quiz-locked {
  background: #d1d5db !important;
  color: #6b7280 !important;
  cursor: not-allowed;
  opacity: 0.75;
}
.btn-quiz-locked:hover { opacity: 0.75; }

.week-action { flex-shrink: 0; }

/* -----------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------- */
.btn-practice,
.btn-practice-sm {
  background: var(--orange);
  color: white;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(230,126,34,0.3);
}

.btn-practice:hover,
.btn-practice-sm:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230,126,34,0.4);
}

.btn-practice-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-review-sm {
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--blue);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  transition: all var(--transition);
}
.btn-review-sm:hover {
  background: var(--blue);
  color: white;
}

.btn-catchup-sm {
  color: #92400e;
  text-decoration: none;
  border: 1px solid #d97706;
  background: #fffbeb;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  transition: all var(--transition);
}
.btn-catchup-sm:hover {
  background: #d97706;
  color: white;
  border-color: #d97706;
}

.journey-description {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.roadmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: #6b7280;
}
.roadmap-legend span { white-space: nowrap; }

/* -----------------------------------------------------------------
   Skills Panel
   ----------------------------------------------------------------- */
.skills-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-bars {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skill-bar label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.skill-bar .bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 4px;
}

.skill-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.skill-level {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  display: block;
}

/* -----------------------------------------------------------------
   Goal Card
   ----------------------------------------------------------------- */
.goal-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  border: 2px solid var(--orange);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
}

.goal-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.goal-target {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.goal-target strong { color: var(--green); }

/* -----------------------------------------------------------------
   Focus Area Card (AI-powered grammar focus from conversation analysis)
   ----------------------------------------------------------------- */
.focus-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  border: 2px solid #f6ad55;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.focus-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f6ad55, #ed8936);
}

.focus-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.focus-pattern {
  font-size: 1rem;
  font-weight: 600;
  color: #7b341e;
  margin-bottom: 6px;
  text-transform: capitalize;
}

.focus-advice {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.focus-advice .focus-line {
  display: block;
  margin-bottom: 4px;
}
.focus-advice .focus-line:last-child {
  margin-bottom: 0;
  margin-top: 6px;
  font-style: italic;
  color: #7b341e;
}

/* -----------------------------------------------------------------
   Login Page
   ----------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--blue-dark) 0%, var(--blue) 40%, #1a6b40 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -200px; right: -200px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(230,126,34,0.1);
  bottom: -150px; left: -100px;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-school-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}

.login-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 24px;
}

.login-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* -----------------------------------------------------------------
   Form Elements
   ----------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

/* -----------------------------------------------------------------
   Primary Button (login, submit)
   ----------------------------------------------------------------- */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(26,83,118,0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,83,118,0.45);
  background: linear-gradient(135deg, var(--blue-light) 0%, #3498DB 100%);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------
   Alert / Message boxes
   ----------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 16px;
  display: none;
}
.alert-error {
  background: #FDECEA;
  color: #C0392B;
  border: 1px solid #F5C6C2;
}
.alert-success {
  background: #EAFAF1;
  color: #1E8449;
  border: 1px solid #A9DFBF;
}

/* -----------------------------------------------------------------
   Chat Page
   ----------------------------------------------------------------- */
.chat-page { background: var(--bg); }

/* Chat header (for Task 15 override) */
.chat-header-bar {
  background: linear-gradient(135deg, var(--blue) 0%, #1a6b40 100%);
  color: white;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(26,83,118,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-back-journey {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-back-journey:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.65);
}

/* -----------------------------------------------------------------
   Teacher Dashboard additions
   ----------------------------------------------------------------- */
.cefr-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.cefr-A1 { background: #EBF5FB; color: #1A5276; }
.cefr-A2 { background: #EAF7F2; color: #1E8449; }
.cefr-B1 { background: #FEF9E7; color: #D68910; }
.cefr-B2 { background: #FDF2E9; color: #D35400; }
.cefr-C1, .cefr-C2 { background: #F5EEF8; color: #6C3483; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--blue-light);
  background: rgba(41,128,185,0.04);
}
.upload-zone-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.upload-result {
  margin-top: 16px;
  font-size: 0.88rem;
  font-weight: 500;
}
.upload-result.success { color: var(--green); }
.upload-result.error   { color: #C0392B; }

/* -----------------------------------------------------------------
   Loading & Error states
   ----------------------------------------------------------------- */
.loading {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 16px auto 0;
}

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

.error {
  padding: 24px;
  text-align: center;
  color: #C0392B;
  font-size: 0.9rem;
  background: #FDECEA;
  border-radius: var(--radius-md);
  border: 1px solid #F5C6C2;
}

/* -----------------------------------------------------------------
   Utility
   ----------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* =================================================================
   Phase 6 — My Journey Redesign
   Six-region layout: welcome hero, mastery banner, today card,
   journey section, reference panels. Reuses existing :root tokens.
   ================================================================= */

/* Region 2: Welcome hero */
.welcome-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.welcome-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.welcome-greeting-block { flex: 1; min-width: 0; }
.welcome-greeting {
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.welcome-goal {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 4px;
}
.welcome-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .welcome-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .welcome-avatar { display: none; }
  .welcome-greeting { font-size: 1.5rem; }
}

/* Region 3: Mastery banner */
.mastery-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mastery-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mastery-banner-eyebrow {
  font-size: 0.875rem; /* 14px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.mastery-banner-levels {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Override .cefr-current / .cefr-target inside the banner — scaled down */
.mastery-banner-levels .cefr-current,
.mastery-banner-levels .cefr-target {
  font-size: 2.5rem; /* 40px */
  font-weight: 800;
  line-height: 1;
}
.mastery-banner-levels .cefr-current { color: var(--blue); }
.mastery-banner-levels .cefr-target { color: var(--green); }
.mastery-banner-levels .cefr-arrow {
  font-size: 1.5rem;
  color: var(--orange);
  font-weight: 700;
}
.mastery-banner-progress { display: flex; flex-direction: column; gap: 8px; }
.mastery-banner-track {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.mastery-banner-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}
.mastery-banner-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mastery-banner-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.mastery-banner-xp {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .mastery-banner { padding: 20px; }
  .mastery-banner-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mastery-banner-levels .cefr-current,
  .mastery-banner-levels .cefr-target { font-size: 2rem; /* 32px */ }
  .mastery-banner-levels .cefr-arrow { font-size: 1.25rem; }
}

/* Start-Here marker: directs students from the mastery banner to today's activities. */
.start-here-marker {
  font-size: 1.75rem; /* 28px, matches .welcome-greeting */
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 12px 0 4px;
}
@media (max-width: 600px) {
  .start-here-marker { font-size: 1.5rem; }
}

/* Region 4: Today card */
.today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-card-eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
}
.today-card-title {
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.today-card-sub {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
}
.today-card-cta {
  align-self: flex-start;
  display: inline-block;
  padding: 16px 28px;
  background: var(--orange);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(230,126,34,0.35);
  transition: all var(--transition);
  min-height: 48px;
  box-sizing: border-box;
}
.today-card-cta:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230,126,34,0.45);
}
.today-card-cta:focus-visible {
  outline: 3px solid rgba(41,128,185,0.4);
  outline-offset: 2px;
}
.today-card-cta:active { transform: translateY(0); }

/* Activity checklist — 3-activity sequence (Vocab / Skills / Chat) */
.today-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-activity {
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease;
}
/* Each row is a real link so keyboard + screen readers can tab to it. */
.today-activity-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.today-activity-link:hover {
  background: rgba(0,0,0,0.02);
}
.today-activity-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.today-activity-active .today-activity-link:hover {
  background: rgba(230,126,34,0.08);
}
.today-activity-done .today-activity-link:hover {
  background: rgba(30,132,73,0.08);
}
.today-activity-marker {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  background: var(--border);
  color: var(--text-muted);
}
.today-activity-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.today-activity-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.today-activity-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.today-activity-done {
  background: rgba(30,132,73,0.06);
  border-color: rgba(30,132,73,0.25);
}
.today-activity-done .today-activity-marker {
  background: var(--green);
  color: white;
}
.today-activity-done .today-activity-label {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: rgba(30,132,73,0.4);
}
.today-activity-active {
  background: var(--orange-bg);
  border-color: rgba(230,126,34,0.4);
}
.today-activity-active .today-activity-marker {
  background: var(--orange);
  color: white;
}
.today-activity-pending .today-activity-marker {
  background: transparent;
  border: 2px solid var(--border);
  color: transparent;
}
/* 2026-05-14 — "caught up" state: the student has no skill due today
   but didn't actively complete anything. Neutral marker so it doesn't
   look like a real done ✓, label kept readable (no strikethrough). */
.today-activity-caught_up {
  background: rgba(107,114,128,0.04);
  border-color: rgba(107,114,128,0.20);
}
.today-activity-caught_up .today-activity-marker {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 700;
}
.today-activity-caught_up .today-activity-label {
  color: var(--text-secondary);
}

/* State 4 — "You're up to date" (green accent, celebratory emphasis) */
.today-card[data-state="done"] {
  border-left-color: var(--green);
  border-left-width: 6px;
  background: linear-gradient(180deg, rgba(46,204,113,0.08) 0%, var(--surface) 60%);
}
.today-card[data-state="done"] .today-card-eyebrow {
  color: var(--green);
  font-size: 1rem;
  letter-spacing: 0.12em;
}
.today-card[data-state="done"] .today-card-title {
  font-size: 2rem;
  line-height: 1.2;
}
.today-card[data-state="done"] .today-card-title::before {
  content: "\2705";
  margin-right: 10px;
}
.today-card[data-state="done"] .today-card-sub {
  font-size: 1.05rem;
  color: var(--text-primary);
}
.today-card[data-state="done"] .today-card-cta {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
  box-shadow: none;
}
.today-card[data-state="done"] .today-card-cta:hover {
  background: var(--blue);
  color: white;
  transform: none;
  box-shadow: none;
}
@media (max-width: 768px) {
  .today-card[data-state="done"] .today-card-title { font-size: 1.65rem; }
}
/* State 5 — "No data yet" (muted, no accent border, no CTA) */
.today-card[data-state="empty"] { border-left-color: var(--border); }
.today-card[data-state="empty"] .today-card-eyebrow { color: var(--text-muted); }
.today-card[data-state="loading"] { border-left-color: var(--border); }

@media (max-width: 768px) {
  .today-card { padding: 24px 20px; }
  .today-card-title { font-size: 1.5rem; }
}

/* Region 5: Journey section */
.journey-section {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.journey-section-heading {
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.locked-weeks-toggle {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--blue);
  font: 700 0.875rem/1.4 'Outfit', sans-serif;
  padding: 12px 8px;
  cursor: pointer;
  text-decoration: none;
}
.locked-weeks-toggle:hover { text-decoration: underline; }
.locked-weeks-toggle:focus-visible {
  outline: 3px solid rgba(41,128,185,0.4);
  outline-offset: 2px;
  border-radius: 4px;
}
.week-hidden { display: none; }

.learning-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.learning-snapshot-heading {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.learning-snapshot-list {
  list-style: none;
  display: grid;
  gap: 8px;
}
.learning-snapshot-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.learning-snapshot-name {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
}
.learning-snapshot-level {
  flex: 0 0 auto;
  color: var(--blue);
  background: #eaf4fb;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}
.learning-snapshot-empty {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .learning-snapshot { grid-template-columns: 1fr; }
  .learning-snapshot-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.journey-map {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0;
}
.journey-term-label {
  align-self: center;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}
.journey-node {
  position: relative;
  min-height: 84px;
  padding: 16px 16px 16px 72px;
  border-left-width: 1px;
  overflow: visible;
}
.journey-node::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 34px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 6px rgba(26,82,118,0.06);
}
.journey-node-path {
  position: absolute;
  left: 40px;
  top: 60px;
  bottom: -26px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26,82,118,0.35), rgba(230,126,34,0.28));
  z-index: 0;
}
.journey-node:last-of-type .journey-node-path { display: none; }
.journey-node-marker {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.journey-node--complete .journey-node-marker { border-color: var(--green); }
.journey-node--current .journey-node-marker {
  border-color: var(--orange);
  box-shadow: 0 0 0 6px rgba(230,126,34,0.14);
}
.journey-node--skipped .journey-node-marker { border-color: #d97706; }
.journey-node--locked .journey-node-marker { border-color: #cbd5e1; }
.journey-node-meta {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}
.journey-node .week-action {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
@media (min-width: 900px) {
  .journey-node {
    width: calc(100% - 72px);
  }
  .journey-node:nth-child(odd) {
    align-self: flex-start;
  }
  .journey-node:nth-child(even) {
    align-self: flex-end;
  }
}
@media (max-width: 640px) {
  .journey-node {
    align-items: flex-start;
    flex-direction: column;
    padding: 68px 14px 14px;
  }
  .journey-node::before { left: 26px; top: 24px; }
  .journey-node-path { left: 35px; top: 54px; bottom: -26px; }
  .journey-node-marker { left: 14px; top: 14px; }
  .journey-node .week-action {
    justify-content: flex-start;
    width: 100%;
  }
  .week-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Region 6: Reference panels */
.reference-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (min-width: 768px) {
  .reference-panels { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.reference-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.reference-card-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
/* Keep the existing blue-tinted vocab card when it also has .reference-card;
   its own blue tint (inline style block on roadmap.html) wins for background. */
.vocab-progress-card.reference-card { box-shadow: var(--shadow-sm); }

/* Games shortcut on My Journey — plain link to /games, no checkmark */
.games-shortcut { margin-top: 16px; }
.games-shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.games-shortcut-card:hover,
.games-shortcut-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}
.games-shortcut-icon {
  font-size: clamp(1.6rem, 5vw, 2rem);
  line-height: 1;
  flex: 0 0 auto;
}
.games-shortcut-text { flex: 1 1 auto; min-width: 0; }
.games-shortcut-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.25;
}
.games-shortcut-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.games-shortcut-cta {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--orange);
  font-size: 0.95rem;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .games-shortcut-card { padding: 14px; gap: 10px; }
  .games-shortcut-cta { font-size: 0.85rem; }
}

/* Completion toast placeholder — styling only; Wave 2 wires the JS */
.today-card-toast {
  background: #EAFAF1;
  color: var(--green);
  border: 1px solid #A9DFBF;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  align-self: flex-start;
  transition: opacity 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .today-card-toast { transition: none; }
}

/* Skip-ahead confirmation modal — shown when a student taps a pending
   activity row. Soft recommend: chat/skill are always clickable, but a
   single friction step reinforces the suggested practice order. */
.skip-confirm-modal[hidden] { display: none; }
.skip-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(26,35,50,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.skip-confirm-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.skip-confirm-eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.skip-confirm-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}
.skip-confirm-body {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}
.skip-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.skip-confirm-cancel {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
}
.skip-confirm-cancel:hover { background: var(--surface-2); }
.skip-confirm-cancel:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.skip-confirm-ok {
  padding: 8px 16px;
  background: var(--orange);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  box-shadow: 0 2px 8px rgba(230,126,34,0.35);
  transition: background 0.18s ease;
}
.skip-confirm-ok:hover { background: var(--orange-light); }
.skip-confirm-ok:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .skip-confirm-actions { flex-direction: column-reverse; align-items: stretch; }
  .skip-confirm-cancel,
  .skip-confirm-ok { width: 100%; justify-content: center; text-align: center; }
}

/* Item A: voice transcripts list + modal in the teacher dashboard. */
.detail-voice-transcripts { margin-top: 1.25rem; }
.detail-voice-transcripts h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.voice-transcripts-list { list-style: none; padding: 0; margin: 0; }
.voice-transcripts-row { margin: 0.25rem 0; }
.voice-transcripts-row-btn {
  background: none;
  border: 1px solid var(--border-soft, #d1d5db);
  border-radius: var(--radius-sm, 6px);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  width: 100%;
  text-align: left;
}
.voice-transcripts-row-btn:hover { background: var(--bg-hover, #f3f4f6); }
.voice-transcripts-empty { color: var(--text-muted, #6b7280); font-size: 0.875rem; margin: 0; }

.voice-transcript-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.voice-transcript-modal {
  background: white;
  border-radius: var(--radius-md, 8px);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
}
.voice-transcript-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.voice-transcript-modal h3 { margin: 0 0 0.5rem; }
.voice-transcript-meta { color: var(--text-muted, #6b7280); font-size: 0.875rem; margin: 0 0 1rem; }
.voice-transcript-turns { display: flex; flex-direction: column; gap: 0.625rem; }
.voice-transcript-turn { line-height: 1.4; }
.voice-transcript-turn--student .voice-transcript-role { color: var(--blue, #2563eb); font-weight: 600; }
.voice-transcript-turn--tutor   .voice-transcript-role { color: var(--orange, #ea580c); font-weight: 600; }
.voice-transcript-text { white-space: pre-wrap; }

/* F8 Track 2 — error-focus quiz card (post chat wrap-up + roadmap surface).
   Inline-in-thread card with primary CTA + secondary "maybe later" link.
   Mobile-first; uses existing tokens so it lands as a peer to the wrap-up
   message rather than competing visually. */
.error-quiz-card {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.error-quiz-card__title {
  font-weight: 600;
  color: var(--orange);
  font-size: 1rem;
}
.error-quiz-card__subtitle {
  color: var(--text-muted, #6b7280);
  font-size: 0.875rem;
}
.error-quiz-card__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.error-quiz-card__btn {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
.error-quiz-card__btn:hover { background: var(--orange-light); }
.error-quiz-card__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.error-quiz-card__skip {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}
.error-quiz-question {
  background: white;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.error-quiz-question__stem {
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}
.error-quiz-question__options {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.error-quiz-option-btn {
  text-align: left;
  background: white;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.error-quiz-option-btn:hover { background: var(--orange-bg); }
.error-quiz-option-btn--selected {
  background: var(--orange-bg);
  border-color: var(--orange);
}
.error-quiz-option-btn:disabled { cursor: default; }
.error-quiz-result {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  border-left: 3px solid var(--text-muted, #6b7280);
}
.error-quiz-result--correct {
  background: #ecfdf5;
  border-left-color: var(--green);
}
.error-quiz-result--incorrect {
  background: #fef2f2;
  border-left-color: #dc2626;
}
.error-quiz-result__verdict { font-weight: 600; margin-bottom: 0.25rem; }
.error-quiz-result__verdict--correct { color: var(--green); }
.error-quiz-result__verdict--incorrect { color: #dc2626; }
.error-quiz-result__feedback { font-size: 0.9rem; line-height: 1.4; }
.error-quiz-result__model {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: var(--text-muted, #6b7280);
}
.error-quiz-result__model strong { color: inherit; }

/* Tier 2 #2 — post-conversation feedback report card (2026-05-05). Sits in
   the chat thread at the wrap-up turn alongside the tutor reply. Same blue
   tone as the tutor message bubble so it reads as part of the lesson rather
   than as a competing notification. Mobile-first; uses existing tokens. */
.feedback-report-card {
  background: var(--blue-bg, #eef4fb);
  border: 1px solid var(--blue, #1A5276);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.feedback-report-card__title {
  font-weight: 600;
  color: var(--blue, #1A5276);
  font-size: 1rem;
}
.feedback-report-card__heading {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue, #1A5276);
  margin-bottom: 0.25rem;
}
.feedback-report-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.feedback-report-card__list-item {
  background: white;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border, #e5e7eb);
}
.feedback-report-card__pattern {
  font-size: 0.95rem;
  line-height: 1.4;
}
.feedback-report-card__example {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.25rem;
  font-style: italic;
}
.feedback-report-card__focus {
  background: white;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-left: 3px solid var(--blue, #1A5276);
}
.feedback-report-card__focus-line {
  font-size: 0.9rem;
  line-height: 1.45;
}
.feedback-report-card__focus-line + .feedback-report-card__focus-line {
  margin-top: 0.25rem;
}
.feedback-report-card__encouragement {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}
.feedback-report-card__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.feedback-report-card__btn {
  background: var(--blue, #1A5276);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
.feedback-report-card__btn:hover { filter: brightness(1.1); }
.feedback-report-card__btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tier 2 #3 — roleplay scenario card + character pill (2026-05-05).
   Card sits as the first thing in the messages area before the AI's
   opening message; pill sits next to the student-grade line in the
   chat header while a scenario is active. */
.roleplay-offer-card {
  background: var(--peach-bg, #fff4ea);
  border: 1px solid var(--peach, #c2410c);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.roleplay-offer-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--peach, #c2410c);
}
.roleplay-offer-card__role {
  font-size: 0.95rem;
  line-height: 1.4;
}
.roleplay-offer-card__goal-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.25rem;
}
.roleplay-offer-card__goal {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted, #6b7280);
}
.roleplay-offer-card__btn {
  background: var(--peach, #c2410c);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 0.25rem;
}
.roleplay-offer-card__btn:hover { filter: brightness(1.08); }
.roleplay-offer-card__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.roleplay-offer-card__error {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}
.roleplay-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--peach-bg, #fff4ea);
  color: var(--peach, #c2410c);
  font-size: 0.8rem;
  line-height: 1.2;
}
.roleplay-pill[hidden] { display: none; }
.roleplay-pill-prefix { font-weight: 600; }
.roleplay-pill-role { font-style: italic; }

/* Teacher dashboard: Error practice section, parallel to Voice transcripts. */
.detail-error-quiz { margin-top: 1rem; }
.detail-error-quiz h4 { margin: 0 0 0.5rem; }
.error-quiz-attempts-empty { color: var(--text-muted, #6b7280); font-size: 0.875rem; }
.error-quiz-attempts-summary { font-size: 0.95rem; margin: 0 0 0.5rem; }
.error-quiz-attempts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.error-quiz-attempts-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  background: #f9fafb;
  border-radius: 0.375rem;
}
.error-quiz-attempts-row__pattern { flex: 1; min-width: 0; }
.error-quiz-attempts-row__score { font-weight: 600; color: var(--text-muted, #6b7280); }
.error-quiz-attempts-row--passed .error-quiz-attempts-row__score { color: var(--green); }

/* Roadmap surface: a sibling-shaped card next to the Thursday banner. */
.roadmap-error-quiz-card {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.roadmap-error-quiz-card__text { flex: 1; min-width: 0; }
.roadmap-error-quiz-card__title { font-weight: 600; color: var(--orange); }
.roadmap-error-quiz-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.125rem;
}
.roadmap-error-quiz-card__btn {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.roadmap-error-quiz-card__btn:hover { background: var(--orange-light); }

/* F14 — four-band rubric label shown in mastery results.
   Reggio Tutor Manual page 11. Color escalates with score band. */
.rubric-band {
  display: inline-block;
  margin: 4px 0 12px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.rubric-band-pendiente {
  background: #fde8e8;
  color: #7a1f1f;
  border-color: #f5b3b3;
}
.rubric-band-por_mejorar {
  background: #fff4d6;
  color: #7a4a00;
  border-color: #f0c97a;
}
.rubric-band-bien {
  background: #e8f4fd;
  color: #1A5276;
  border-color: #9ec6e4;
}
.rubric-band-muy_bien {
  background: #e8f8ef;
  color: #1a6b40;
  border-color: #8ed1a8;
}

/* Option 2.1 — spaced retention section on /learn. Sits at the top so the
   recall task gets seen first (testing-effect priority). Quiet styling so
   it reads as "review, not new content". */
.retention-section {
  background: #fff8ec;
  border: 1px solid #f0d6a3;
  border-radius: 12px;
  padding: 14px 18px 18px;
  margin: 0 0 20px;
}
.retention-section h3 {
  margin: 0 0 6px;
  color: #7a4a00;
  font-size: 1.1rem;
}
.retention-intro {
  margin: 0 0 14px;
  color: #6b4a14;
  font-size: 0.92rem;
}
.retention-cards { display: flex; flex-direction: column; gap: 12px; }
.retention-card {
  background: #fff;
  border: 1px solid #e6d2a7;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.retention-card__lead {
  margin: 6px 0 10px;
  font-size: 0.98rem;
  color: #1A5276;
  font-weight: 700;
}
.retention-interval-label {
  display: inline-block;
  padding: 3px 10px;
  background: #fff1cf;
  color: #7a4a00;
  border: 1px solid #e6c46f;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Option 2.2 — 21d retention cards get a faint blue tint to set them
   apart from 7d originals, plus a small badge above the questions. */
.retention-card--transfer {
  background: #f5faff;
  border-color: #c9deef;
}
.retention-card--transfer .retention-interval-label {
  background: #e7f2fb;
  color: #1A5276;
  border-color: #9fc5e2;
}
.retention-transfer-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 10px;
  background: #1A5276;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  text-transform: uppercase;
}
.retention-transfer-intro {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #1A5276;
  font-style: italic;
}
.retention-card__form { display: flex; flex-direction: column; gap: 10px; }
.retention-q {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}
.retention-q__legend {
  font-weight: 600;
  font-size: 0.93rem;
  padding: 0 4px;
  color: #222;
}
.retention-q__option {
  display: block;
  padding: 6px 10px;
  margin-top: 6px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}
.retention-q__option:hover {
  background: #f0f7ff;
  border-color: #1A5276;
}
.retention-q__option input { accent-color: #1A5276; margin-right: 6px; }
.retention-card__submit {
  align-self: flex-start;
  background: #1A5276;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 22px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
}
.retention-card__submit:hover { opacity: 0.9; }
.retention-card__submit:disabled { opacity: 0.55; cursor: wait; }
.retention-next-step {
  margin: 6px 0 12px;
  font-size: 0.93rem;
  color: #1A5276;
  font-weight: 600;
}
.retention-feedback {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.retention-feedback strong { display: block; margin-bottom: 3px; }
.retention-feedback--correct { background: #e8f8ef; border-left: 3px solid #1a6b40; }
.retention-feedback--incorrect { background: #fde8e8; border-left: 3px solid #c0392b; }
.retention-feedback__why { color: #555; font-style: italic; margin-top: 3px; }
.retention-error {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fde8e8;
  border-left: 3px solid #c0392b;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* -----------------------------------------------------------------
   Student Content Studio: My Work and Activity pages
   These pages intentionally reuse the roadmap shell/header so they feel
   embedded in the student site instead of like a separate app.
   ----------------------------------------------------------------- */
.my-work-hero::before {
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
}
.my-work-card {
  border-left-color: var(--green);
}
.work-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.work-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.work-card h2 {
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1.25;
}
.work-card p { color: var(--text-secondary); }
.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-meta .badge,
.activity-page .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #EEF6F2;
  color: var(--green);
  border: 1px solid #CFE5D8;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}
.work-link {
  align-self: flex-start;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}
.work-link:hover,
.work-link:focus-visible { text-decoration: underline; }
.empty {
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-secondary);
}
.activity-page {
  background: #F5F1E6;
}
.activity-page .activity-shell {
  max-width: 860px;
}

/* ---- Hero: academic dark-green header ---- */
.activity-page .activity-hero {
  color: white;
  background:
    radial-gradient(circle at 88% 16%, rgba(255,255,255,0.10) 0, transparent 38%),
    radial-gradient(circle at 6% 90%, rgba(255,255,255,0.06) 0, transparent 42%),
    linear-gradient(135deg, #0A2E22 0%, #1E8449 52%, #0F3D2E 100%);
  border-radius: 20px;
  padding: 34px 36px;
  box-shadow: 0 16px 40px rgba(15,61,46,0.28);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.activity-page .activity-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0, transparent 70%);
  pointer-events: none;
}
.activity-page .activity-hero > * { position: relative; z-index: 1; }
.activity-page .activity-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: rgba(255,255,255,0.78);
}
.activity-page .activity-title {
  font-size: clamp(1.85rem, 4.2vw, 2.7rem);
  line-height: 1.04;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
}
.activity-page .activity-subtitle {
  color: rgba(255,255,255,0.92);
  max-width: 760px;
  font-size: 1.02rem;
  line-height: 1.5;
}
.activity-page .activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.activity-page .activity-meta .badge {
  background: rgba(255,255,255,0.18);
  color: white;
  border-color: rgba(255,255,255,0.30);
  font-size: 0.8rem;
  padding: 6px 12px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

/* ---- Generic card surfaces ---- */
.activity-page .activity-card,
.activity-page .worksheet-instruction-card,
.activity-page .worksheet-section {
  background: var(--surface);
  border: 1px solid #E8E0CF;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(39,59,45,0.06);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.activity-page .activity-card h2,
.activity-page .worksheet-instruction-card h2,
.activity-page .worksheet-section h2 {
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1.2;
}
.activity-page .activity-card { border-left: 4px solid var(--green); }
.activity-page .activity-card--focus { border-left-color: var(--blue); }
.activity-page .activity-card--practice { border-left-color: var(--green); }
.activity-page .activity-card--evidence { border-left-color: var(--orange); }
.activity-page .activity-card--finish,
.activity-page .activity-progress-card { border-left-color: var(--green-light); }

/* ---- Progress card ---- */
.activity-page .activity-progress-card {
  padding: 20px 24px;
  gap: 10px;
  position: sticky;
  top: 12px;
  z-index: 5;
}
.activity-page .progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.activity-page .progress-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.activity-page .progress-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.activity-page .progress-track {
  height: 14px;
  background: #ECE3D2;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15,61,46,0.08);
}
.activity-page .progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1E8449, #27AE60 60%, #2ECC71);
  transition: width 300ms ease;
  border-radius: 999px;
}
.activity-page .progress-label {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
}

/* ---- Rules + directions ---- */
.activity-page .rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.activity-page .rule-card,
.activity-page .directions-box {
  background: #FAF7F0;
  border: 1px solid #E8E0CF;
  border-radius: 10px;
  padding: 14px 16px;
}
.activity-page .rule-card ul,
.activity-page .directions-box ul,
.activity-page .activity-card > ul {
  padding-left: 20px;
}

/* ---- Section nav pills ---- */
.activity-page .worksheet-section-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}
.activity-page .worksheet-section-pill {
  min-height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  background: white;
  color: var(--green);
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px 12px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15,61,46,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.activity-page .worksheet-section-pill:hover,
.activity-page .worksheet-section-pill:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,61,46,0.16);
  outline: 3px solid rgba(41,128,185,0.22);
  outline-offset: 2px;
}
.activity-page .worksheet-pill-letter {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: currentColor;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.activity-page .worksheet-pill-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.activity-page .worksheet-pill-label {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.15;
}

/* ---- Worksheet section card ---- */
.activity-page .worksheet-section {
  scroll-margin-top: 86px;
  gap: 14px;
}
.activity-page .worksheet-section-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.activity-page .worksheet-section-badge {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: currentColor;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.activity-page .worksheet-section-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.activity-page .worksheet-section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.activity-page .worksheet-section-heading h2 {
  font-size: 1.18rem;
}
.activity-page .worksheet-section-heading p {
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: 0.94rem;
}
.activity-page .worksheet-section-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: currentColor;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.activity-page .worksheet-section-divider {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor 0%, currentColor 65%, transparent);
  opacity: 1;
}

/* ---- Section color codes ---- */
.activity-page .worksheet-section--fill_blank { color: #1E8449; }
.activity-page .worksheet-section--multiple_choice {
  color: #2980B9;
  --worksheet-choice-selected-bg: #DDF0E3;
  --worksheet-choice-selected-border: #2E7D53;
  --worksheet-choice-selected-text: #183C2A;
}
.activity-page .worksheet-section--sentence_correction { color: #7D3C98; }
.activity-page .worksheet-section--sentence_creation { color: #E67E22; }
.activity-page .worksheet-section--paragraph_writing { color: #C2185B; }

/* ---- Worksheet item (question) ---- */
.activity-page .worksheet-item {
  background: #FFFEFB;
  border: 1px solid #ECE3D2;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-primary);
}
.activity-page .worksheet-item--correct {
  background: #EAF7EE;
  border-color: #8ED1A5;
}
.activity-page .worksheet-item--incorrect {
  background: #FDECEC;
  border-color: #E8A1A1;
}
.activity-page .worksheet-prompt {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1rem;
}
.activity-page .worksheet-question-number {
  color: currentColor;
  font-weight: 900;
  flex: 0 0 auto;
}
.activity-page .worksheet-prompt-text {
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
}
.activity-page .response-label {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.activity-page .options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.activity-page .worksheet-options {
  display: grid;
  gap: 8px;
}

/* ---- Buttons ---- */
.activity-page .worksheet-option-btn {
  min-height: 48px;
  border-radius: 10px;
  padding: 12px 44px 12px 16px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  text-align: left;
  position: relative;
}
.activity-page .worksheet-option-btn:hover:not(:disabled),
.activity-page .worksheet-option-btn:focus-visible {
  border-color: currentColor;
  background: rgba(0,0,0,0.02);
  box-shadow: var(--shadow-sm);
  outline: 3px solid rgba(41,128,185,0.18);
  outline-offset: 2px;
}
.activity-page .worksheet-option-btn[aria-pressed="true"] {
  background: var(--worksheet-choice-selected-bg, #DDF0E3);
  color: var(--worksheet-choice-selected-text, #183C2A);
  border-color: var(--worksheet-choice-selected-border, #2E7D53);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(46,125,83,0.18);
}
.activity-page .worksheet-option-btn[aria-pressed="true"]::after,
.activity-page .worksheet-option-btn--correct::after {
  content: '✓';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--worksheet-choice-selected-border, #2E7D53);
}
.activity-page .worksheet-option-btn--correct {
  background: #E4F6E9;
  color: #183C2A;
  border-color: #2E7D53;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(46,125,83,0.16);
}
.activity-page .worksheet-option-btn--incorrect,
.activity-page .worksheet-option-btn--incorrect[aria-pressed="true"] {
  background: #FCE4E4;
  color: #7A1F1F;
  border-color: #C0392B;
  box-shadow: 0 4px 12px rgba(192,57,43,0.14);
}
.activity-page .worksheet-option-btn--incorrect[aria-pressed="true"]::after {
  content: '✕';
  color: #C0392B;
}

/* ---- Inputs ---- */
.activity-page textarea,
.activity-page input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  padding: 12px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.activity-page textarea:hover:not(:disabled),
.activity-page input[type="text"]:hover:not(:disabled) {
  border-color: var(--text-muted);
}
.activity-page textarea:focus,
.activity-page input[type="text"]:focus {
  outline: none;
  border-color: currentColor;
  box-shadow: 0 0 0 3px rgba(41,128,185,0.18);
}
.activity-page textarea.worksheet-response--correct,
.activity-page input[type="text"].worksheet-response--correct {
  border-color: #2E7D53;
  box-shadow: 0 0 0 3px rgba(46,125,83,0.14);
}
.activity-page textarea.worksheet-response--incorrect,
.activity-page input[type="text"].worksheet-response--incorrect {
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}
.activity-page textarea {
  min-height: 140px;
  line-height: 1.5;
  resize: vertical;
}
.activity-page .worksheet-instruction-line {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}
.activity-page .worksheet-error-sentence {
  color: #B83227;
  text-decoration: line-through;
  font-weight: 800;
}
.activity-page .worksheet-check-btn {
  align-self: flex-start;
  min-height: 40px;
  padding: 9px 16px;
  font-size: 0.9rem;
}
.activity-page .worksheet-feedback-pill {
  align-self: flex-start;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}
.activity-page .worksheet-feedback-pill--correct {
  background: #DFF3E6;
  color: #1E6B3B;
}
.activity-page .worksheet-feedback-pill--incorrect {
  background: #F9DEDE;
  color: #A52820;
}
.activity-page .worksheet-feedback-pill--needs_review {
  background: #FFF0D8;
  color: #8A5200;
}
.activity-page .worksheet-answer-hint {
  color: #7A1F1F;
  font-weight: 700;
  line-height: 1.45;
}

/* ---- Word count badge ---- */
.activity-page .worksheet-word-count {
  display: inline-flex;
  align-self: flex-end;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.05);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}
.activity-page .word-count-value {
  font-weight: 800;
  color: currentColor;
  font-variant-numeric: tabular-nums;
}
.activity-page .word-count-value.is-complete {
  color: #1E8449;
}

/* ---- Help marker ---- */
.activity-page .worksheet-help-marker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.activity-page .worksheet-help-marker input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: currentColor;
}

/* ---- Finish card: strong ending ---- */
.activity-page .activity-card--finish {
  background:
    radial-gradient(circle at 92% 10%, rgba(255,255,255,0.08) 0, transparent 50%),
    linear-gradient(135deg, #0A2E22 0%, #145A32 50%, #0F3D2E 100%);
  border-color: transparent;
  color: white;
  padding: 28px;
  box-shadow: 0 16px 36px rgba(10,46,34,0.30);
  position: relative;
  overflow: hidden;
}
.activity-page .activity-card--finish::after {
  content: '';
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0, transparent 70%);
  pointer-events: none;
}
.activity-page .activity-card--finish > * { position: relative; z-index: 1; }
.activity-page .activity-card--finish h2 {
  color: white;
  font-size: 1.4rem;
}
.activity-page .activity-card--finish .activity-actions {
  color: rgba(255,255,255,0.92);
}
.activity-page .activity-card--finish .activity-actions > div:first-child {
  font-size: 0.96rem;
  line-height: 1.5;
}
.activity-page .activity-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.activity-page .activity-name-field {
  display: grid;
  gap: 7px;
  color: rgba(255,255,255,0.92);
  font-weight: 800;
  max-width: 420px;
}
.activity-page .activity-name-field span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.activity-page .activity-name-field input[type="text"] {
  background: rgba(255,255,255,0.96);
  color: var(--text-primary);
}

.activity-page .btn { border: 0; text-decoration: none; }
.activity-page .btn {
  min-height: 48px;
  border-radius: 10px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.activity-page .btn-secondary {
  background: var(--surface-2);
  color: var(--blue);
  border: 1.5px solid var(--border);
}
.activity-page .btn-secondary:hover:not(:disabled),
.activity-page .btn-secondary:focus-visible {
  background: #EEF6FB;
  outline: 3px solid rgba(41,128,185,0.18);
  outline-offset: 2px;
}
.activity-page .activity-card--finish .btn-secondary {
  background: rgba(255,255,255,0.14);
  color: white;
  border-color: rgba(255,255,255,0.34);
}
.activity-page .activity-card--finish .btn-secondary:hover:not(:disabled),
.activity-page .activity-card--finish .btn-secondary:focus-visible {
  background: rgba(255,255,255,0.22);
}
.activity-page .btn-primary {
  background: linear-gradient(135deg, #27AE60, #2ECC71);
  color: white;
  box-shadow: 0 6px 18px rgba(46,204,113,0.36);
}
.activity-page .btn-primary:hover:not(:disabled),
.activity-page .btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(46,204,113,0.46);
  outline: 3px solid rgba(46,204,113,0.22);
  outline-offset: 2px;
}
.activity-page .btn:disabled,
.activity-page .worksheet-option-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.activity-page .worksheet-option-btn--selected:disabled,
.activity-page .worksheet-option-btn--correct:disabled,
.activity-page .worksheet-option-btn--incorrect:disabled {
  opacity: 1;
}

.activity-page .result {
  padding: 12px 16px;
  border-radius: 10px;
  background: #EAFAF1;
  border: 1px solid #A9DFBF;
  color: var(--green);
  font-weight: 700;
}
.activity-page .activity-card--finish .result {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.28);
  color: white;
}
.activity-page .feedback-list {
  display: grid;
  gap: 8px;
}
.activity-page .feedback-item {
  border-left: 4px solid var(--text-muted);
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--text-primary);
}
.activity-page .activity-card--finish .feedback-item {
  background: rgba(255,255,255,0.10);
  color: white;
}
.activity-page .feedback-item strong {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin-right: 6px;
}
.activity-page .feedback-item.correct { border-left-color: #2ECC71; }
.activity-page .feedback-item.incorrect { border-left-color: #E74C3C; }
.activity-page .feedback-item.needs_review { border-left-color: var(--orange-light); }

@media (max-width: 600px) {
  .activity-page .activity-hero { padding: 26px 22px; }
  .activity-page .activity-card,
  .activity-page .worksheet-instruction-card,
  .activity-page .worksheet-section,
  .activity-page .activity-card--finish { padding: 20px; }
  .activity-page .activity-progress-card { padding: 18px 20px; }
  .activity-page .worksheet-section-nav { grid-template-columns: 1fr; }
  .activity-page .worksheet-section-pill {
    min-height: 56px;
    grid-template-columns: 38px auto 1fr;
    grid-template-rows: auto;
  }
  .activity-page .worksheet-pill-letter { grid-row: auto; }
  .activity-page .worksheet-section-badge { width: 48px; height: 48px; font-size: 1.35rem; }
  .activity-page .activity-actions { align-items: stretch; }
  .activity-page .activity-actions .options { width: 100%; }
  .activity-page .activity-actions .btn { flex: 1 1 auto; justify-content: center; }
}


/* XP progress chart: stacked area graph for activity points */
.xp-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 18px;
}
.xp-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.xp-chart-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.xp-chart-total {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef8f0;
  color: var(--green);
  font-weight: 800;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
}
.xp-progress-chart {
  width: 100%;
  min-height: 220px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  overflow: hidden;
}
.xp-progress-svg {
  display: block;
  width: 100%;
  height: auto;
}
.xp-chart-gridline {
  stroke: #dbe3ea;
  stroke-width: 1;
}
.xp-chart-axis {
  stroke: #9aa8b4;
  stroke-width: 1.25;
}
.xp-chart-axis-label {
  fill: #5f6f7b;
  font-size: 12px;
  font-weight: 700;
}
.xp-chart-line,
.xp-chart-dot,
.xp-chart-possible-line {
  vector-effect: non-scaling-stroke;
}
.xp-chart-line {
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.12));
}
.xp-chart-dot {
  stroke: #fff;
  stroke-width: 2;
}
.xp-chart-possible-line {
  stroke: #64748b;
  stroke-width: 2;
  stroke-dasharray: 7 6;
}
.xp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}
.xp-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.xp-chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.xp-chart-swatch-possible {
  background: repeating-linear-gradient(90deg, #64748b 0 5px, transparent 5px 9px);
  border-radius: 2px;
}
.xp-chart-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
  padding: 18px;
}
.weeks-section-heading {
  margin-top: 6px;
}
.week-meta {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .xp-chart-header { flex-direction: column; }
  .xp-chart-total { align-self: flex-start; }
}
