/* ==========================================================================
   mathwithcye • KSSM Additional Mathematics Form 5
   Chapter 1: Circular Measure (Sukatan Membulat)
   Lesson 1.2: Arc Length of a Circle (Panjang Lengkok Suatu Bulatan)
   Responsive Design System, Touchscreen Ready, Teacher Teaching Tool & Remote
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0ea5e9;
  --secondary-light: #f0f9ff;
  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --dark: #0f172a;
  --card-bg: #ffffff;
  --bg-page: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-math: "Cambria Math", "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   MATHEMATICAL FRACTION & TYPOGRAPHY STANDARDS (GEMINI.md STRICT COMPLIANCE)
   ========================================================================== */
.math-var {
  font-family: var(--font-math);
  font-style: italic;
  font-weight: 600;
  padding: 0 1px;
}

.math-sym {
  font-family: var(--font-math);
  font-style: normal;
  padding: 0 2px;
}

.math-frac {
  display: inline-flex !important;
  flex-direction: column !important;
  vertical-align: middle !important;
  text-align: center !important;
  padding: 0 4px !important;
  font-size: 0.9em !important;
  line-height: 1 !important;
}

.math-num {
  border-bottom: 1.5px solid currentColor !important;
  padding-bottom: 2px !important;
  margin-bottom: 2px !important;
  display: block !important;
  line-height: 1 !important;
  text-align: center !important;
}

.math-den {
  padding-top: 2px !important;
  display: block !important;
  line-height: 1 !important;
  text-align: center !important;
}

.katex {
  font-size: 1.06em !important;
}

/* ==========================================================================
   LAYOUT CONTAINERS & APP HEADER
   ========================================================================== */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px 80px 20px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.curriculum-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.lesson-title-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-chap {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.badge-subtopic {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-tb {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* User Session Bar */
.user-session-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.student-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.student-avatar {
  font-size: 1.1rem;
}

.student-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.student-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.student-class {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-icon-xs {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 2px;
}

.btn-icon-xs:hover {
  opacity: 1;
}

.session-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.points-pill {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */
.progress-bar-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   6-STAGE NAVIGATION TABS
   ========================================================================== */
.stage-nav-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .stage-nav-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 550px) {
  .stage-nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stage-tab-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.stage-tab-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.stage-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.tab-stage-id {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.stage-tab-btn.active .tab-stage-id {
  opacity: 0.9;
}

.tab-stage-name {
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* ==========================================================================
   STAGE SECTION CARDS (COMMON)
   ========================================================================== */
.stage-card {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

.stage-card.active {
  display: block;
}

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

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-stage {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.stage-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.stage-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.lead-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 24px;
}

/* Stage Navigation Buttons */
.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-page);
  border-color: #cbd5e1;
}

/* ==========================================================================
   STAGE A: MISSION BRIEF
   ========================================================================== */
.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 850px) {
  .mission-grid {
    grid-template-columns: 1fr;
  }
}

.dskp-card,
.real-world-challenge-card,
.symbol-decoder-card,
.profile-input-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.dskp-card {
  border-left: 4px solid var(--primary);
}

.real-world-challenge-card {
  border-left: 4px solid var(--warning);
}

.symbol-decoder-card {
  border-left: 4px solid var(--accent);
}

.profile-input-card {
  border-left: 4px solid var(--success);
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dskp-card .card-label { color: var(--primary); }
.real-world-challenge-card .card-label { color: #d97706; }
.symbol-decoder-card .card-label { color: var(--accent); }
.profile-input-card .card-label { color: #059669; }

.dskp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.dskp-list li {
  font-size: 0.92rem;
  line-height: 1.45;
  padding-left: 20px;
  position: relative;
}

.dskp-list li::before {
  content: "🎯";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

.dilemma-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.dilemma-desc {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.symbol-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.9rem;
}

.symbol-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-muted);
}

.symbol-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.input-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.text-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   STAGE B: DISCOVERY LAB - THE DYNAMIC ARC LENGTH & SECTOR STUDIO
   ========================================================================== */
.lab-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .lab-container {
    grid-template-columns: 1fr;
  }
}

.lab-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.lab-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.lab-panel-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.svg-canvas-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.svg-canvas-card svg {
  width: 100%;
  max-width: 290px !important;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
  overflow: hidden;
}

/* Lab Controls */
.lab-controls-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.slider-styled {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.slider-styled::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  transition: transform 0.1s;
}

.slider-styled::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.preset-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 500px) {
  .preset-btn-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-preset {
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-preset:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.btn-preset.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e293b;
  font-family: var(--font-mono);
}

/* ==========================================================================
   STAGE C: INTERACTIVE WORKED EXAMPLES
   ========================================================================== */
.example-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.example-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.example-tag {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.example-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.example-sub-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-top: 16px;
}

.step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 12px;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
  display: block;
}

.step-content {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   STAGE D: GUIDED PRACTICE
   ========================================================================== */
.guided-container,
.challenge-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.question-card:hover {
  border-color: #cbd5e1;
}

.q-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.q-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.q-badge.foundation {
  background: #dcfce7;
  color: #166534;
}

.q-badge.intermediate {
  background: #dbeafe;
  color: #1e40af;
}

.q-badge.advanced {
  background: #fef3c7;
  color: #92400e;
}

.q-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.q-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
  line-height: 1.6;
}

.question-diagram-wrapper {
  margin: 12px auto 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.textbook-diagram-svg {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 220px !important;
  height: auto;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.option-btn {
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-btn.correct {
  background: #dcfce7 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}

.option-btn.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

/* Hints */
.hints-container {
  margin-top: 14px;
}

.btn-hint-toggle {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: #d97706;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-hint-toggle:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.hint-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: #92400e;
  line-height: 1.5;
}

.solution-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: #166534;
  line-height: 1.6;
}

.step-line {
  margin-bottom: 4px;
}

/* ==========================================================================
   INTEGRATED MILESTONES (GEMINI.md STRICT COMPLIANCE)
   ========================================================================== */

/* MILESTONE 1: SPM MISCONCEPTION BUSTER */
.misconception-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 36px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.misconception-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.misconception-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.misconception-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.misconception-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 800px) {
  .misconception-grid {
    grid-template-columns: 1fr;
  }
}

.pitfall-box {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 20px;
}

.pitfall-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #dc2626;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.standard-sol-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 20px;
}

.standard-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #16a34a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.examiner-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #92400e;
  line-height: 1.5;
}

/* MILESTONE 2: THE VAULT & THE GOLDEN TAKEAWAY */
.summary-vault-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.vault-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.vault-badge {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.vault-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.vault-matrix-table th {
  background: var(--bg-page);
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
}

.vault-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.golden-takeaway-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.15);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.golden-trophy-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.golden-content {
  flex: 1;
}

.golden-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #b45309;
  margin-bottom: 6px;
}

.golden-mnemonic {
  font-size: 1.05rem;
  font-weight: 800;
  color: #92400e;
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}

.golden-desc {
  font-size: 0.92rem;
  color: #78350f;
  line-height: 1.5;
}

/* ==========================================================================
   STAGE F: EXIT TICKET & LEARNING CERTIFICATE
   ========================================================================== */
.exit-ticket-container {
  margin-bottom: 32px;
}

.certificate-card {
  background: #ffffff;
  border: 3px double #0f172a;
  border-radius: var(--radius-md);
  padding: 32px;
  margin-top: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.cert-header {
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.cert-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #0f172a;
  text-transform: uppercase;
}

.cert-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cert-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 1rem;
  line-height: 1.6;
}

.cert-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
}

.cert-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
}

.cert-meta-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.cert-golden-takeaway {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #92400e;
  margin-top: 10px;
}

/* ==========================================================================
   CLASSROOM TEACHER TEACHING TOOL & ANNOTATION LAYER
   ========================================================================== */
.teaching-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}

.teaching-layer.mode-drawing,
.teaching-layer.mode-laser,
.teaching-layer.mode-eraser {
  pointer-events: auto !important;
}

.teaching-layer.mode-drawing {
  cursor: crosshair;
}

.teaching-layer.mode-laser {
  cursor: none;
}

.teaching-layer.mode-eraser {
  cursor: cell;
}

#drawingCanvas,
#laserCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.teaching-toolbar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9999px;
  padding: 6px 14px 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-drag-handle {
  cursor: grab;
  color: #64748b;
  font-size: 1.1rem;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-drag-handle:active {
  cursor: grabbing;
}

.toolbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn,
.toolbar-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-family: inherit !important;
  line-height: 1 !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  outline: none !important;
  box-shadow: none !important;
}

.tool-btn:hover,
.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}

.tool-btn.active,
.toolbar-btn.active {
  background: var(--primary, #2563eb) !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6) !important;
}

.tool-icon {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tool-label {
  font-size: 0.8rem;
  letter-spacing: 0.2px;
  line-height: 1;
}

.toolbar-remote-dot,
.remote-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  margin-left: 2px;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
  transition: all 0.3s ease;
}

.toolbar-remote-dot.connected,
.remote-dot.connected {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.btn-toolbar-minimize,
.toolbar-btn.btn-minimize {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 50% !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  outline: none !important;
  box-shadow: none !important;
}

.btn-toolbar-minimize:hover,
.toolbar-btn.btn-minimize:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  transform: none !important;
  box-shadow: none !important;
}

.toolbar-expand-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #0f172a;
  color: #ffffff;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.toolbar-expand-pill:hover {
  background: #1e293b;
  border-color: #64748b;
  transform: translateY(-2px);
}

.tool-toast-notification {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 10000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid #334155;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
  pointer-events: none;
}

/* Strict Utility Hidden Directive */
.hidden {
  display: none !important;
}

/* ==========================================================================
   PRINT STYLESHEET (Clean Single/Double-Page PDF Learning Certificate)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header,
  .progress-bar-wrapper,
  .stage-nav-tabs,
  .stage-footer,
  .btn,
  .teaching-toolbar,
  .toolbar-expand-pill,
  .teaching-layer,
  .misconception-card,
  .summary-vault-card,
  .exit-ticket-container,
  #stageA, #stageB, #stageC, #stageD, #stageE {
    display: none !important;
  }
  #stageF {
    display: block !important;
    border: none !important;
    padding: 0 !important;
  }
  .certificate-card {
    display: block !important;
    box-shadow: none !important;
    border: 3px double #000000 !important;
    page-break-inside: avoid;
    margin: 0 !important;
    padding: 24px !important;
  }
  .cert-golden-takeaway {
    display: block !important;
  }
}
