/* ==========================================================================
   BQ24 In-App PDF Presentation & Document Reading Engine
   - 16:9 Slide Presentation Mode & Continuous Document Scroll Mode
   - Real-time Reading Stopwatch (HH:MM:SS) with background tab pause
   - Dynamic Progress Indicator & Bar (e.g. 12 / 30 бет · 40%)
   - Bookmarks («Бетбелгілер») & Personal Notes («Жеке ескертпелер»)
   - In-document Search with Page Jumps
   - Quiz Bridge («Куизді бастау») & Self-Check («Өзіңді тексер»)
   - Teacher Reading Analytics Modal
   ========================================================================== */

.bq24-pdf-viewer {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-2, #0b1120);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 8px 12px -6px rgba(0, 0, 0, 0.4);
  position: relative;
  font-family: inherit;
  width: 100%;
}

.bq24-pdf-viewer:fullscreen,
.bq24-pdf-viewer:-webkit-full-screen,
.bq24-pdf-viewer.bq24-fullscreen-fallback {
  border-radius: 0 !important;
  border: none !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 999999 !important;
}

.bq24-pdf-viewer.bq24-fullscreen-fallback {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.bq24-pdf-viewer:fullscreen .bq24-pdf-main-body,
.bq24-pdf-viewer:-webkit-full-screen .bq24-pdf-main-body,
.bq24-pdf-viewer.bq24-fullscreen-fallback .bq24-pdf-main-body {
  height: calc(100vh - 46px) !important;
  height: calc(100dvh - 46px) !important;
  max-height: none !important;
  flex: 1 !important;
}

/* --- Top Toolbar --- */
.bq24-pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color, #1e293b);
  color: var(--text-color, #f1f5f9);
  z-index: 10;
}

.bq24-pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bq24-pdf-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bq24-pdf-title {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  color: #f1f5f9;
}

/* Stopwatch & Mastery Badges */
.bq24-pdf-stopwatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.bq24-pdf-stopwatch-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
  animation: bq24Pulse 2s infinite ease-in-out;
}

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

.bq24-pdf-mastery-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  transition: all 0.25s ease;
}

.bq24-pdf-mastery-badge.status-mastered {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.bq24-pdf-mastery-badge.status-in_progress {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.bq24-pdf-mastery-badge.status-unread {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

/* Toolbar Buttons - Clearly Visible and Clickable */
.bq24-pdf-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  padding: 6px 10px;
  min-height: 32px;
  min-width: 32px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.bq24-pdf-btn svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bq24-pdf-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  transform: translateY(-1px);
}

.bq24-pdf-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bq24-pdf-btn.active {
  background: rgba(59, 130, 246, 0.28);
  border-color: #3b82f6;
  color: #93c5fd;
}

.bq24-pdf-btn.btn-gold {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.16);
}

/* Reading Mode Switcher Pill */
.bq24-pdf-mode-switch {
  display: inline-flex;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.bq24-pdf-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  line-height: 1;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.bq24-pdf-mode-btn svg {
  stroke: currentColor;
  pointer-events: none;
}

.bq24-pdf-mode-btn span {
  pointer-events: none;
}

.bq24-pdf-mode-btn:hover {
  color: #f1f5f9;
}

.bq24-pdf-mode-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.bq24-pdf-mode-btn.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Page Input & Progress Indicator */
.bq24-pdf-page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.bq24-pdf-page-input {
  width: 42px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  padding: 4px 4px;
  font-size: 0.82rem;
  text-align: center;
  font-weight: 700;
}

.bq24-pdf-page-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Reading Progress Bar (under toolbar) */
.bq24-pdf-progress-stripe {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.bq24-pdf-progress-stripe-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  width: 0%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bq24-pdf-progress-badge {
  font-size: 0.76rem;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}

/* Search Bar in Toolbar */
.bq24-pdf-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bq24-pdf-search-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #ffffff;
  padding: 5px 26px 5px 28px;
  font-size: 0.8rem;
  width: 130px;
  transition: width 0.2s ease, border-color 0.2s ease;
}

.bq24-pdf-search-input:focus {
  width: 170px;
  outline: none;
  border-color: #3b82f6;
}

.bq24-pdf-search-icon {
  position: absolute;
  left: 8px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.bq24-pdf-search-count {
  position: absolute;
  right: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* --- Main Presentation / Document Area --- */
.bq24-pdf-main-body {
  display: flex;
  position: relative;
  min-height: 480px;
  height: 70vh;
  max-height: 860px;
  background: #020617;
  overflow: hidden;
}

.bq24-pdf-viewer:fullscreen .bq24-pdf-main-body {
  height: calc(100vh - 50px);
  max-height: none;
}

/* Left Thumbnail Sidebar */
.bq24-pdf-sidebar {
  width: 175px;
  min-width: 175px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color, #1e293b);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, width 0.2s ease, min-width 0.2s ease;
}

.bq24-pdf-sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  overflow: hidden;
  display: none;
}

.bq24-pdf-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.bq24-pdf-thumb-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.bq24-pdf-thumb-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.bq24-pdf-thumb-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bq24-pdf-thumb-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bq24-pdf-thumb-num {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 600;
}

.bq24-pdf-thumb-item.active .bq24-pdf-thumb-num {
  color: #60a5fa;
  font-weight: 700;
}

/* Center Stage (Slide Mode: 16:9 Presentation Canvas) */
.bq24-pdf-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  user-select: none;
  touch-action: pan-y pinch-zoom;
}

.bq24-pdf-canvas-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7);
  background: #000000;
  border-radius: 8px;
  overflow: hidden;
}

.bq24-pdf-canvas {
  display: block;
  flex-shrink: 0;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.05s ease-out;
}

/* Document Mode: Continuous Vertical Scroll Stream */
.bq24-pdf-doc-stream {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: #020617;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.bq24-pdf-doc-page {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: #0f172a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 240px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bq24-pdf-doc-page.search-highlight {
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.45);
}

.bq24-pdf-doc-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.bq24-pdf-doc-page-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  font-weight: 600;
  z-index: 2;
}

.bq24-pdf-doc-page-spinner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.8rem;
}

/* Prev / Next Floating Arrows in Slide Mode */
.bq24-pdf-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.bq24-pdf-nav-arrow svg {
  stroke: currentColor;
}

.bq24-pdf-nav-arrow:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.9);
  border-color: #3b82f6;
  transform: translateY(-50%) scale(1.08);
}

.bq24-pdf-nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

.bq24-pdf-nav-prev {
  left: 12px;
}

.bq24-pdf-nav-next {
  right: 12px;
}

/* Drawers / Panels (Bookmarks & Notes) */
.bq24-pdf-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid var(--border-color, #1e293b);
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 25;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bq24-pdf-drawer.open {
  transform: translateX(0);
}

.bq24-pdf-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color, #1e293b);
}

.bq24-pdf-drawer-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 7px;
}

.bq24-pdf-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bq24-pdf-drawer-empty {
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
  padding: 30px 10px;
}

.bq24-pdf-bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bq24-pdf-bookmark-item:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.bq24-pdf-note-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.bq24-pdf-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
}

.bq24-pdf-note-text {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.bq24-pdf-note-input {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 70px;
}

.bq24-pdf-note-input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Quiz Bridge Card on Completion */
.bq24-pdf-completion-card {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 20;
  animation: bq24SlideUp 0.3s ease-out;
}

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

.bq24-pdf-completion-info {
  display: flex;
  flex-direction: column;
}

.bq24-pdf-completion-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bq24-pdf-completion-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.bq24-pdf-quiz-btn {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bq24-pdf-quiz-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  transform: translateY(-1px);
}

/* Loading Overlay */
.bq24-pdf-loading {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 20;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.bq24-pdf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: bq24Spin 0.8s linear infinite;
}

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

/* Mastery Toast */
.bq24-pdf-mastery-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bq24-pdf-mastery-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Teacher Stats Modal Overlay */
.bq24-pdf-stats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.bq24-pdf-stats-modal {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.bq24-pdf-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.bq24-pdf-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.bq24-pdf-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f1f5f9;
}

.bq24-pdf-stat-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* --- Mobile Responsiveness (Screen <= 768px) --- */
@media (max-width: 768px) {
  .bq24-pdf-sidebar {
    display: none !important;
  }

  .bq24-pdf-toolbar {
    padding: 6px 10px;
    gap: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .bq24-pdf-title-wrap {
    gap: 6px;
    max-width: 58%;
    flex-shrink: 1;
  }

  .bq24-pdf-title {
    max-width: 120px;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bq24-pdf-mastery-badge {
    padding: 2px 6px;
    font-size: 0.72rem;
    gap: 3px;
  }

  .bq24-pdf-stopwatch-badge {
    padding: 3px 7px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .bq24-pdf-progress-badge {
    font-size: 0.74rem;
    padding: 2px 6px;
  }

  .bq24-pdf-main-body {
    height: auto;
    min-height: calc((100vw - 16px) * 9 / 16 + 8px);
    max-height: 75vh;
  }

  .bq24-pdf-viewer.mode-doc .bq24-pdf-main-body,
  .bq24-pdf-viewer.mode-doc .bq24-pdf-doc-stream {
    height: min(72vh, calc(100dvh - 160px));
    min-height: 340px;
  }

  .bq24-pdf-stage {
    padding: 4px;
    min-height: calc((100vw - 16px) * 9 / 16);
    overflow: hidden;
  }

  .bq24-pdf-zoom-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
  }

  .bq24-pdf-zoom-group .bq24-pdf-btn {
    min-width: 28px;
    min-height: 28px;
    padding: 3px 5px;
  }

  #bq24ZoomPercent {
    font-size: 0.72rem;
    font-weight: 700;
  }

  .bq24-pdf-nav-arrow {
    display: flex !important;
    width: 36px;
    height: 36px;
    background: rgba(15, 23, 42, 0.88);
  }

  .bq24-pdf-nav-prev {
    left: 4px;
  }

  .bq24-pdf-nav-next {
    right: 4px;
  }

  .bq24-pdf-hide-mobile {
    display: none !important;
  }

  .bq24-pdf-mode-btn span {
    display: none;
  }

  .bq24-pdf-mode-btn {
    padding: 5px 7px;
  }

  .bq24-pdf-page-nav {
    gap: 2px;
  }

  .bq24-pdf-page-input {
    width: 36px;
    padding: 2px;
    font-size: 0.78rem;
  }

  .bq24-pdf-drawer {
    width: 100%;
  }

  .bq24-pdf-completion-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .bq24-pdf-completion-actions {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile Landscape orientation */
@media (max-width: 900px) and (orientation: landscape) {
  .bq24-pdf-main-body {
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }

  .bq24-pdf-toolbar {
    padding: 4px 8px;
    flex-wrap: nowrap;
  }
}

/* --- Past Lessons Badges --- */
.badge-pill-unread {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.badge-pill-in_progress {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.badge-pill-mastered {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}
