/* ═══════════════════════════════════════════════════════════
   KAIVALYA ACADEMY — ENTERPRISE TEACHER PORTAL STYLES
   Design System: Premium Navy & Amber Gold Glassmorphism
   ═══════════════════════════════════════════════════════════ */

:root {
  --tp-navy-900: #030a1c;
  --tp-navy-800: #061334;
  --tp-navy-700: #0c1e4d;
  --tp-navy-600: #122b6b;
  --tp-gold-500: #f59e0b;
  --tp-gold-400: #fbbf24;
  --tp-gold-300: #fcd34d;
  --tp-emerald: #10b981;
  --tp-rose: #f43f5e;
  --tp-blue-accent: #38bdf8;
  --tp-text-light: #f8fafc;
  --tp-text-muted: #94a3b8;
  --tp-card-bg: rgba(255, 255, 255, 0.05);
  --tp-card-border: rgba(245, 158, 11, 0.25);
  --tp-glass-border: rgba(255, 255, 255, 0.12);
  --tp-radius-lg: 20px;
  --tp-radius-md: 12px;
  --tp-radius-sm: 8px;
  --tp-shadow-glow: 0 10px 30px -5px rgba(245, 158, 11, 0.25);
  --tp-shadow-card: 0 16px 40px rgba(0, 0, 0, 0.35);
  --tp-font-sans: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --tp-font-mr: 'Noto Sans Devanagari', 'Poppins', sans-serif;
}

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

body {
  font-family: var(--tp-font-sans);
  background: radial-gradient(circle at 15% 15%, #0f2766 0%, #061334 45%, #020715 100%);
  color: var(--tp-text-light);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ════════════ TOPBAR & NAVIGATION ════════════ */
.tp-topbar {
  background: rgba(3, 10, 28, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tp-glass-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tp-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.tp-logo-frame {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--tp-gold-500);
  padding: 2px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--tp-shadow-glow);
}

.tp-logo-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tp-brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.tp-brand-text h1 span {
  color: var(--tp-gold-400);
}

.tp-brand-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tp-gold-300);
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tp-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.tp-nav-btn-outline {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--tp-glass-border);
}

.tp-nav-btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.tp-nav-btn-gold {
  background: linear-gradient(135deg, var(--tp-gold-500), #d97706);
  color: #030a1c;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.tp-nav-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* ════════════ AUTH OVERLAY (GATEWAY) ════════════ */
.tp-auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 28, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tp-auth-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tp-auth-box {
  background: linear-gradient(145deg, #0d2258 0%, #061334 100%);
  border: 1.5px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), var(--tp-shadow-glow);
  position: relative;
  overflow: hidden;
}

.tp-auth-box::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
}

.tp-auth-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.tp-auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.tp-auth-sub {
  color: var(--tp-text-muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.tp-auth-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.tp-auth-input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: all 0.3s ease;
}

.tp-auth-input:focus {
  border-color: var(--tp-gold-400);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.tp-auth-btn {
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--tp-gold-500) 0%, #d97706 100%);
  color: #030a1c;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.tp-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.55);
}

.tp-auth-hint {
  font-size: 0.8rem;
  color: var(--tp-gold-300);
  margin-top: 16px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--tp-radius-sm);
  display: inline-block;
  cursor: pointer;
  transition: background 0.2s;
}

.tp-auth-hint:hover {
  background: rgba(245, 158, 11, 0.2);
}

.tp-auth-error {
  color: var(--tp-rose);
  font-size: 0.88rem;
  margin-top: 10px;
  font-weight: 600;
  min-height: 20px;
}

/* ════════════ MAIN CONTAINER ════════════ */
.tp-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px 20px 80px 20px;
}

/* ════════════ HERO BANNER ════════════ */
.tp-hero {
  background: linear-gradient(135deg, rgba(18, 43, 107, 0.6) 0%, rgba(6, 19, 52, 0.9) 100%);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 32px 36px;
  margin-bottom: 30px;
  box-shadow: var(--tp-shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.tp-hero::after {
  content: '🧮';
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 11rem;
  opacity: 0.04;
  pointer-events: none;
}

.tp-hero-content {
  flex: 1;
  min-width: 300px;
}

.tp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.tp-hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--tp-emerald);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.tp-hero-title {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #ffffff;
}

.tp-hero-title span {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tp-hero-desc {
  color: #cbd5e1;
  font-size: 1rem;
  max-width: 720px;
}

.tp-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-stat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  padding: 14px 20px;
  text-align: center;
  min-width: 110px;
  backdrop-filter: blur(8px);
}

.tp-stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--tp-gold-400);
}

.tp-stat-lbl {
  font-size: 0.75rem;
  color: var(--tp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ════════════ MAIN TABS ════════════ */
.tp-module-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tp-module-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tp-glass-border);
  border-radius: 50px;
  padding: 12px 24px;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tp-module-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tp-module-tab.active {
  background: linear-gradient(135deg, var(--tp-navy-600) 0%, var(--tp-navy-700) 100%);
  border-color: var(--tp-gold-500);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.25);
}

/* ════════════ MODULE CONTENT PANELS ════════════ */
.tp-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tp-panel.active {
  display: block;
}

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

/* ════════════ LEVEL SELECTOR SUB-BAR ════════════ */
.tp-level-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 28px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tp-level-strip::-webkit-scrollbar,
.tp-lvl-subnav::-webkit-scrollbar {
  display: none;
}

.tp-lvl-btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 12px;
  border-radius: var(--tp-radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tp-glass-border);
  color: #cbd5e1;
  cursor: pointer;
  scroll-snap-align: start;
  text-align: center;
  transition: all 0.25s ease;
}

.tp-lvl-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.tp-lvl-btn.active {
  background: linear-gradient(145deg, #10296b 0%, #0c1e4d 100%);
  border-color: var(--tp-gold-400);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}

.tp-lvl-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tp-gold-400);
}

.tp-lvl-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* ════════════ LEVEL SUB-NAVIGATION TABS ════════════ */
.tp-lvl-subnav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--tp-glass-border);
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tp-lvl-subtab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tp-glass-border);
  color: #cbd5e1;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  scroll-snap-align: start;
}

.tp-lvl-subtab:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(245, 158, 11, 0.35);
}

.tp-lvl-subtab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%);
  border-color: var(--tp-gold-400);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.tp-subpanel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tp-subpanel.active {
  display: block;
}

/* ════════════ DETAILED STEP-BY-STEP SOLVED EXAMPLES ════════════ */
.tp-solved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.tp-solved-card {
  background: rgba(15, 39, 102, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--tp-radius-md);
  padding: 20px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tp-solved-card:hover {
  transform: translateY(-2px);
  border-color: var(--tp-gold-400);
}

.tp-solved-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.tp-solved-math {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--tp-gold-300);
  font-family: monospace;
}

.tp-solved-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--tp-blue-accent);
  text-transform: uppercase;
}

.tp-step-item {
  margin-bottom: 10px;
  padding-left: 28px;
  position: relative;
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.tp-step-badge {
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tp-gold-500);
  color: #030a1c;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-bead-instruction {
  color: #93c5fd;
  font-size: 0.84rem;
  display: block;
  margin-top: 2px;
}

.tp-solved-ans {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: var(--tp-radius-sm);
  text-align: right;
  margin-top: 12px;
}

/* ════════════ FORMULA INSPECTOR CARD ════════════ */
.tp-formula-detail-card {
  background: linear-gradient(135deg, rgba(8, 26, 75, 0.9) 0%, rgba(3, 10, 28, 0.95) 100%);
  border: 1.5px solid var(--tp-gold-500);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tp-formula-badge-lg {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--tp-gold-400);
  font-family: monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 18px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: inline-block;
  margin-bottom: 12px;
}

/* ════════════ ORAL DICTATION BANK TABLE ════════════ */
.tp-dict-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tp-dict-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  padding: 16px;
  transition: all 0.2s ease;
}

.tp-dict-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--tp-gold-400);
}

.tp-dict-item-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--tp-gold-400);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tp-dict-seq {
  font-size: 1.15rem;
  font-family: monospace;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.6;
}

.tp-dict-ans-reveal {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--tp-emerald);
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 6px;
}

/* ════════════ FINGER MECHANICS VISUAL CARDS & VIDEO HUB ════════════ */
.tp-finger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tp-finger-card {
  background: linear-gradient(145deg, rgba(12, 30, 77, 0.75) 0%, rgba(6, 19, 52, 0.9) 100%);
  border: 1.5px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.tp-finger-card:hover {
  transform: translateY(-4px);
  border-color: var(--tp-gold-400);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45), var(--tp-shadow-glow);
}

.tp-finger-img-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #020715;
}

.tp-finger-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tp-finger-card:hover .tp-finger-img-wrap img {
  transform: scale(1.05);
}

.tp-finger-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(3, 10, 28, 0.88);
  border: 1px solid var(--tp-gold-400);
  color: var(--tp-gold-300);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.tp-finger-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tp-finger-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.tp-finger-rule-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
}

.tp-finger-tip {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--tp-gold-500);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #fde68a;
  margin-bottom: 14px;
}

.tp-finger-video-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--tp-glass-border);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tp-finger-video-btn:hover {
  background: var(--tp-gold-500);
  color: #030a1c;
  border-color: #f59e0b;
}

/* ════════════ VIDEO MASTER CLASS SECTION ════════════ */
.tp-video-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--tp-glass-border);
}

.tp-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.tp-video-card {
  background: rgba(15, 39, 102, 0.35);
  border: 1.5px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tp-video-card:hover {
  transform: translateY(-4px);
  border-color: var(--tp-gold-400);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.tp-video-thumb-wrap {
  position: relative;
  height: 160px;
  background: #020715;
  overflow: hidden;
}

.tp-video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.tp-video-card:hover .tp-video-thumb-wrap img {
  opacity: 1;
}

.tp-video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.tp-video-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tp-gold-500);
  color: #030a1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.tp-video-card:hover .tp-video-play-icon {
  transform: scale(1.15);
}

.tp-video-dur-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
}

.tp-video-info {
  padding: 14px 16px;
}

.tp-video-info h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.tp-video-info p {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

/* ════════════ VIDEO MODAL ════════════ */
.tp-video-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tp-video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 28, 0.9);
  backdrop-filter: blur(12px);
}

.tp-video-modal-dialog {
  position: relative;
  background: #061334;
  border: 1.5px solid var(--tp-gold-500);
  border-radius: var(--tp-radius-lg);
  max-width: 780px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  z-index: 10;
}

.tp-video-modal-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--tp-glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tp-video-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.tp-video-modal-sub {
  font-size: 0.78rem;
  color: var(--tp-gold-300);
  display: block;
}

.tp-video-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
  transition: color 0.2s;
}

.tp-video-modal-close:hover {
  color: #ffffff;
}

.tp-video-modal-body {
  padding: 20px;
}

.tp-video-player-container {
  width: 100%;
  background: #020715;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--tp-glass-border);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tp-video-player-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.tp-speed-btn.active {
  background: var(--tp-gold-500);
  color: #030a1c;
  font-weight: 800;
}

.tp-video-cues-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: #d1fae5;
  line-height: 1.6;
}

/* ─── SIMULATOR STAGE & HUD ─── */
.tp-sim-stage {
  width: 100%;
  height: 340px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at center, #0a1e4a 0%, #020715 80%);
  padding: 18px 24px;
  overflow: hidden;
}

.tp-sim-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.tp-sim-step-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--tp-gold-400);
  color: var(--tp-gold-300);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tp-sim-indicator-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #10b981;
}

.tp-sim-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: tpPulseLive 1.5s infinite;
}

@keyframes tpPulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.tp-sim-canvas-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 4;
}

.tp-sim-hud-bottom {
  z-index: 5;
}

.tp-sim-caption-box {
  background: rgba(3, 10, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  color: #ffffff;
  font-size: 0.92rem;
  text-align: center;
  font-weight: 600;
  backdrop-filter: blur(8px);
  margin-bottom: 8px;
}

.tp-sim-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.tp-sim-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  width: 0%;
  transition: width 0.15s linear;
}

.tp-sim-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tp-sim-tab {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tp-glass-border);
  color: #94a3b8;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tp-sim-tab.active {
  background: var(--tp-gold-500);
  color: #030a1c;
  border-color: var(--tp-gold-500);
}

/* ════════════ LEVEL DETAIL VIEW CARD ════════════ */
.tp-level-card {
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 32px;
  box-shadow: var(--tp-shadow-card);
  backdrop-filter: blur(14px);
}

.tp-level-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tp-glass-border);
}

.tp-level-title-wrap h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.tp-level-title-wrap p {
  color: var(--tp-gold-300);
  font-weight: 600;
  font-size: 0.95rem;
}

.tp-meta-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-meta-badge {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--tp-glass-border);
  color: #e2e8f0;
}

/* ════════════ PEDAGOGY GRIDS & CARDS ════════════ */
.tp-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.tp-info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.tp-info-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

.tp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
}

.tp-card-header .icon {
  font-size: 1.35rem;
}

.tp-script-box {
  background: rgba(15, 39, 102, 0.4);
  border-left: 4px solid var(--tp-gold-400);
  border-radius: 0 var(--tp-radius-sm) var(--tp-radius-sm) 0;
  padding: 16px 20px;
  color: #f1f5f9;
  font-size: 0.96rem;
  line-height: 1.7;
  font-style: italic;
  font-family: var(--tp-font-mr);
}

.tp-warning-card {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--tp-radius-md);
  padding: 20px;
}

.tp-warning-card .tp-card-header {
  color: #fda4af;
}

.tp-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tp-formula-pill {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--tp-radius-sm);
  padding: 10px 8px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--tp-gold-300);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-formula-pill:hover {
  background: var(--tp-gold-500);
  color: #030a1c;
  transform: scale(1.04);
}

.tp-bullet-list {
  list-style: none;
  padding: 0;
}

.tp-bullet-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.tp-bullet-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--tp-gold-400);
  font-weight: 900;
}

/* ════════════ INTERACTIVE VIRTUAL MASTER ABACUS ════════════ */
.tp-abacus-card {
  background: linear-gradient(135deg, rgba(8, 22, 60, 0.8) 0%, rgba(3, 10, 28, 0.95) 100%);
  border: 1.5px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 30px;
  box-shadow: var(--tp-shadow-card);
  margin-bottom: 30px;
  text-align: center;
}

.tp-abacus-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tp-glass-border);
}

.tp-abacus-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 24px;
  border-radius: 50px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tp-abacus-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--tp-gold-400);
  letter-spacing: 1px;
}

.tp-abacus-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-btn-ctrl {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--tp-glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.tp-btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--tp-gold-400);
}

/* The Abacus Frame */
.tp-abacus-frame {
  max-width: 760px;
  margin: 0 auto;
  background: #2a1810;
  border: 8px solid #5a3825;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 12px 30px rgba(0,0,0,0.5);
  position: relative;
  user-select: none;
}

.tp-rods-container {
  display: flex;
  justify-content: space-around;
  position: relative;
  height: 250px;
}

.tp-abacus-beam {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  height: 12px;
  background: #140b06;
  border-top: 1px solid #7c4a2a;
  border-bottom: 1px solid #7c4a2a;
  z-index: 5;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.tp-unit-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 4px #ffffff;
}

.tp-rod {
  position: relative;
  width: 50px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tp-rod::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: #c2956c;
  z-index: 1;
}

.tp-upper-deck {
  height: 65px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 2;
  position: relative;
}

.tp-lower-deck {
  height: 165px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
  position: relative;
  gap: 2px;
}

.tp-bead {
  width: 44px;
  height: 22px;
  margin: 0 auto;
  border-radius: 11px;
  background: linear-gradient(180deg, #fcd34d 0%, #d97706 70%, #92400e 100%);
  border: 1px solid #78350f;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 2px 3px rgba(255,255,255,0.4);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 3;
}

.tp-bead:active {
  transform: scale(0.96);
}

/* Active Upper Bead moves down to touch beam */
.tp-bead.upper.active {
  transform: translateY(38px);
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 70%, #0369a1 100%);
  border-color: #075985;
}

/* Active Lower Beads move up to touch beam */
.tp-bead.lower.active {
  transform: translateY(-38px);
  background: linear-gradient(180deg, #34d399 0%, #059669 70%, #065f46 100%);
  border-color: #047857;
}

.tp-rod-label {
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* ════════════ ORAL DICTATION METRONOME ENGINE ════════════ */
.tp-dictation-box {
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 32px;
  margin-bottom: 30px;
  text-align: center;
}

.tp-dictation-screen {
  background: rgba(3, 10, 28, 0.8);
  border: 2px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--tp-radius-md);
  padding: 36px 20px;
  margin: 24px 0;
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tp-dict-call {
  font-size: 3.2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  transition: all 0.2s ease;
}

.tp-dict-call.active {
  color: var(--tp-gold-400);
  transform: scale(1.1);
}

.tp-dict-sub {
  font-size: 1rem;
  color: var(--tp-text-muted);
  margin-top: 8px;
}

.tp-dict-answer-box {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tp-emerald);
  margin-top: 14px;
}

.tp-config-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tp-select-ctrl {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--tp-glass-border);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.tp-select-ctrl option {
  background: #061334;
  color: #ffffff;
}

/* ════════════ DYNAMIC WORKSHEET GENERATOR ════════════ */
.tp-worksheet-section {
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 32px;
}

.tp-worksheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tp-glass-border);
}

.tp-sheet-paper {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--tp-radius-md);
  padding: 36px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.tp-sheet-header {
  border-bottom: 2px solid #002147;
  padding-bottom: 12px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tp-sheet-header h3 {
  font-size: 1.4rem;
  color: #002147;
  font-weight: 900;
}

.tp-sheet-fields {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}

.tp-sums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.tp-sum-card {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: monospace;
}

.tp-sum-num {
  font-size: 0.72rem;
  color: #64748b;
  text-align: left;
  margin-bottom: 4px;
  font-family: var(--tp-font-sans);
}

.tp-sum-ans-line {
  border-top: 1.5px solid #002147;
  margin-top: 6px;
  padding-top: 4px;
  min-height: 24px;
  color: #0284c7;
  font-weight: 800;
}

/* ════════════ HANDBOOK / PEDAGOGY ACCORDION ════════════ */
.tp-pedagogy-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  margin-bottom: 14px;
  overflow: hidden;
}

.tp-pedagogy-trigger {
  padding: 18px 24px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s;
}

.tp-pedagogy-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tp-pedagogy-body {
  padding: 20px 24px;
  color: #cbd5e1;
  border-top: 1px solid var(--tp-glass-border);
  line-height: 1.8;
  display: none;
}

.tp-pedagogy-item.open .tp-pedagogy-body {
  display: block;
}

.tp-pedagogy-item.open .tp-pedagogy-trigger {
  background: rgba(18, 43, 107, 0.4);
  color: var(--tp-gold-400);
}

/* ════════════ VISUAL MINI-ABACUS ROD COMPONENT ════════════ */
.tp-bead-visualizer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(3, 10, 28, 0.7);
  padding: 8px 14px;
  border-radius: var(--tp-radius-md);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-top: 8px;
}

.tp-mini-rod {
  width: 32px;
  height: 90px;
  background: #1a0f0a;
  border: 2px solid #5a3825;
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 2px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.8);
}

.tp-mini-rod::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #c2956c;
  z-index: 1;
}

.tp-mini-beam {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  height: 4px;
  background: #ffffff;
  z-index: 4;
  box-shadow: 0 0 3px #ffffff;
}

.tp-mini-bead {
  width: 24px;
  height: 10px;
  margin: 0 auto;
  border-radius: 5px;
  background: #475569;
  border: 1px solid #334155;
  z-index: 2;
  transition: all 0.2s;
  position: relative;
}

.tp-mini-bead.upper {
  background: #64748b;
}

.tp-mini-bead.upper.active {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border-color: #78350f;
  transform: translateY(12px);
  box-shadow: 0 0 8px #f59e0b;
}

.tp-mini-bead.lower.active {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  border-color: #047857;
  transform: translateY(-12px);
  box-shadow: 0 0 6px #10b981;
}

.tp-rod-indicator-text {
  font-size: 0.82rem;
  color: var(--tp-gold-300);
  font-weight: 700;
  line-height: 1.4;
}

/* ════════════ OFFICIAL COLOR WORKBOOKS STUDIO ════════════ */
.tp-book-studio {
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 30px;
}

.tp-book-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tp-glass-border);
}

/* ════════════ 12-PAGE BOOK NAVIGATOR BAR ════════════ */
.tp-book-nav-bar {
  background: rgba(12, 30, 77, 0.7);
  border: 1.5px solid var(--tp-card-border);
  border-radius: var(--tp-radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tp-book-view-mode {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.tp-book-view-mode .tp-btn-ctrl.active {
  background: linear-gradient(135deg, var(--tp-gold-500) 0%, #d97706 100%);
  color: #030a1c;
  font-weight: 800;
  border-color: #fbbf24;
}

.tp-page-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(3, 10, 28, 0.5);
  border: 1px solid var(--tp-glass-border);
  border-radius: 50px;
  padding: 6px 14px;
}

.tp-current-page-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  flex: 1;
  min-width: 220px;
}

.tp-current-page-badge span {
  color: var(--tp-gold-300);
}

.tp-quick-page-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  border-top: 1px dotted rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.tp-quick-page-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--tp-glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-quick-page-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: var(--tp-gold-400);
}

.tp-quick-page-pill.active {
  background: var(--tp-gold-500);
  color: #030a1c;
  border-color: #f59e0b;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Single page visibility state */
.tp-book-preview-container.single-page-mode .tp-book-page {
  display: none;
}

.tp-book-preview-container.single-page-mode .tp-book-page.active-page {
  display: block;
  animation: fadeInPage 0.25s ease-in-out;
}

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

.tp-book-preview-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Printable Color Book Page (A4 Simulation) */
.tp-book-page {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border: 4px double #002147;
  position: relative;
  overflow: hidden;
  page-break-after: always;
}

/* Color Cover Page */
.tp-book-cover {
  background: radial-gradient(circle at 50% 20%, #ffffff 0%, #f1f5f9 100%);
  border: 8px solid #002147;
  padding: 48px 36px;
  text-align: center;
  position: relative;
}

.tp-cover-badge-top {
  display: inline-block;
  background: #002147;
  color: #fbbf24;
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.tp-cover-logo-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  border: 4px solid #f59e0b;
  padding: 4px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 33, 71, 0.2);
}

.tp-cover-logo-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tp-cover-main-title {
  font-size: 2.3rem;
  font-weight: 900;
  color: #002147;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.tp-cover-main-sub {
  font-size: 1.1rem;
  color: #d97706;
  font-weight: 700;
  margin-bottom: 24px;
}

.tp-cover-level-box {
  background: linear-gradient(135deg, #002147 0%, #0c2b64 100%);
  color: #ffffff;
  padding: 24px 30px;
  border-radius: 16px;
  border: 2px solid #f59e0b;
  margin: 20px auto;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0, 33, 71, 0.25);
}

.tp-cover-level-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fcd34d;
}

.tp-cover-student-details {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 30px auto 20px auto;
  max-width: 540px;
  text-align: left;
  background: rgba(255, 255, 255, 0.8);
}

.tp-field-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px dotted #cbd5e1;
  padding-bottom: 4px;
}

.tp-cover-footer-text {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 24px;
  line-height: 1.5;
}

/* Interior Worksheet Page in Book */
.tp-book-inner-header {
  border-bottom: 2.5px solid #002147;
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tp-book-inner-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #002147;
}

.tp-book-inner-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
}

.tp-book-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.tp-book-sum-cell {
  border: 1.5px solid #002147;
  border-radius: 8px;
  padding: 10px 8px;
  background: #f8fafc;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: monospace;
}

.tp-book-sum-cell-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  font-family: var(--tp-font-sans);
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 2px;
  margin-bottom: 4px;
}

.tp-book-ans-box {
  border-top: 1.5px solid #002147;
  margin-top: 6px;
  padding-top: 4px;
  min-height: 22px;
  color: #0284c7;
  font-size: 1rem;
}

.tp-book-page-footer {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

/* Dedicated Answer Key Page at Back */
.tp-book-answers-page {
  background: #fffbeb;
  border-color: #d97706;
}

.tp-ans-key-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 16px;
}

/* Multi-Page Workbook Inner Enhancements */
.tp-unit-banner {
  background: linear-gradient(135deg, #002147 0%, #0c2b64 100%);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tp-unit-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fcd34d;
}

.tp-unit-target {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  padding: 2px 10px;
  border-radius: 20px;
  color: #fbbf24;
}

.tp-toc-container {
  border: 2px solid #002147;
  border-radius: 12px;
  padding: 20px;
  margin: 18px 0;
  background: #f8fafc;
}

.tp-toc-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px dotted #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.tp-toc-row:last-child {
  border-bottom: none;
}

.tp-rules-pledge-box {
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  border-radius: 10px;
  padding: 16px;
  margin-top: 18px;
  color: #14532d;
  font-size: 0.92rem;
}

.tp-exam-section-head {
  background: #e0f2fe;
  border-left: 4px solid #0284c7;
  padding: 8px 14px;
  font-weight: 800;
  color: #0369a1;
  font-size: 0.95rem;
  margin: 16px 0 10px 0;
  display: flex;
  justify-content: space-between;
}

.tp-book-back-cover {
  background: radial-gradient(circle at 50% 80%, #ffffff 0%, #e2e8f0 100%);
  border: 8px solid #002147;
  padding: 40px;
  text-align: center;
}

.tp-page-num-pill {
  background: #002147;
  color: #ffffff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
}

/* ════════════ TEACHER COMPETENCY TESTING SIMULATOR ════════════ */
.tp-testing-card {
  background: var(--tp-card-bg);
  border: 1.5px solid var(--tp-card-border);
  border-radius: var(--tp-radius-lg);
  padding: 32px;
  box-shadow: var(--tp-shadow-card);
}

.tp-quiz-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 16px 0 24px 0;
  overflow: hidden;
}

.tp-quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.tp-question-card {
  background: rgba(15, 39, 102, 0.4);
  border: 1px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.tp-quiz-q-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
  line-height: 1.5;
}

.tp-quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tp-quiz-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--tp-glass-border);
  border-radius: var(--tp-radius-md);
  padding: 14px 18px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-quiz-opt-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--tp-gold-400);
  transform: translateX(4px);
}

.tp-quiz-opt-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--tp-emerald) !important;
  color: #34d399 !important;
}

.tp-quiz-opt-btn.wrong {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: var(--tp-rose) !important;
  color: #fda4af !important;
}

/* Certificate Preview Card */
.tp-certificate-card {
  background: #ffffff;
  color: #002147;
  border: 10px double #002147;
  border-radius: 16px;
  padding: 40px;
  max-width: 720px;
  margin: 30px auto;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

.tp-cert-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #002147;
  text-transform: uppercase;
}

.tp-cert-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #d97706;
  text-decoration: underline;
  margin: 14px 0;
}

/* ════════════ PRINT STYLES FOR BOOKS & CERTIFICATES ════════════ */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .tp-topbar, .tp-hero, .tp-module-nav, .tp-level-strip, .tp-book-toolbar, 
  .tp-book-nav-bar, .tp-worksheet-toolbar, .tp-abacus-card, .tp-dictation-box, 
  .tp-auth-modal, #panel-curriculum, #panel-virtual-abacus, #panel-dictation, 
  #panel-handbook, #panel-testing {
    display: none !important;
  }
  
  /* When printing from books tab, ensure worksheets are hidden */
  #panel-worksheets {
    display: none !important;
  }
  
  .tp-container {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .tp-book-preview-container {
    max-width: 100% !important;
    gap: 0 !important;
  }

  /* In print mode, ALWAYS show ALL 12 pages regardless of single page view */
  .tp-book-preview-container.single-page-mode .tp-book-page {
    display: block !important;
  }
  
  .tp-book-page {
    display: block !important;
    box-shadow: none !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    min-height: 270mm !important;
    border: 2px solid #002147 !important;
    box-sizing: border-box !important;
  }

  .tp-book-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* ════════════ RESPONSIVE ════════════ */
@media (max-width: 768px) {
  .tp-hero {
    padding: 24px 20px;
  }
  .tp-hero-title {
    font-size: 1.6rem;
  }
  .tp-level-card {
    padding: 20px;
  }
  .tp-topbar {
    padding: 10px 16px;
  }
  .tp-rods-container {
    height: 210px;
  }
  .tp-rod {
    width: 36px;
  }
  .tp-bead {
    width: 32px;
    height: 18px;
  }
  .tp-abacus-beam {
    top: 55px;
  }
  .tp-book-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

