/* =============================================================================
   CBT SMK PRATIWI PRABUMULIH — BILIK UJIAN SISWA GEN-2
   FILE: WinCBT/css/student.css
   PANDUAN: dokumen/PetaArsitektur/siswaUI.md
   PRINSIP: Mobile-First Android, Ergonomi Jempol (Min 50px), Low Cognitive Load
   ============================================================================= */

:root {
  /* ================= TEMA TERANG DEFAULT (PAPER LIGHT) ================= */
  --cbt-student-bg:          #f8fafc;
  --cbt-student-card:        #ffffff;
  --cbt-student-card-border: #e2e8f0;
  --cbt-student-text:        #1e293b;
  --cbt-student-text-muted:  #64748b;
  --cbt-student-topbar-bg:   #0b192c;
  --cbt-student-bottombar-bg:#ffffff;
  --cbt-student-bottombar-border: #e2e8f0;

  /* Opsi Jawaban (Light) */
  --cbt-option-bg:           #ffffff;
  --cbt-option-border:       #cbd5e1;
  --cbt-option-text:         #334155;
  --cbt-option-badge-bg:     #f1f5f9;
  --cbt-option-badge-text:   #475569;
  --cbt-option-sel-bg:       #ecfdf5;
  --cbt-option-sel-border:   #10b981;
  --cbt-option-sel-text:     #065f46;
  --cbt-option-sel-badge-bg: #10b981;
  --cbt-option-sel-badge-text: #ffffff;

  /* Navigasi Sebelumnya (Light) */
  --cbt-btn-prev-bg:         #f1f5f9;
  --cbt-btn-prev-border:     #cbd5e1;
  --cbt-btn-prev-text:       #475569;

  /* Brand & Status Navigasi Nomor Soal */
  --cbt-student-navy:        #0b192c;
  --cbt-student-navy-light:  #1e293b;
  --cbt-student-blue:        #2563eb;
  --cbt-student-blue-hover:  #1d4ed8;
  --cbt-no-idle:             #e2e8f0;
  --cbt-no-idle-text:        #475569;
  --cbt-no-doubt:            #f59e0b;
  --cbt-no-answered:         #10b981;

  /* ================= GERBANG DUAL-TOKEN ================= */
  --cbt-token-mulai-border:  #10b981;
  --cbt-token-kirim-border:  #f59e0b;

  /* ================= ERGONOMI SENTUH PONSEL ================= */
  --cbt-btn-min-height:      50px;
  --cbt-radius-mobile:       12px;
  --cbt-font-soal-size:      1.02rem;
  --cbt-font-opsi-size:      0.95rem;
}

/* =============================================================================
   TEMA MALAM ERGONOMIS & OLED BATTERY SAVER (ANTI-GLARE & HEMAT DAYA)
   PANDUAN: dokumen/PetaArsitektur/siswaUI.md (Bab 3)
   PRINSIP: Deep Slate (#0b0f19), Bukan Hitam Pekat, Kontras Lembut 11:1
   ============================================================================= */
[data-theme="dark"] {
  --cbt-student-bg:          #0b0f19; /* Deep Night Slate (OLED friendly) */
  --cbt-student-card:        #111c2e; /* Charcoal Night Card */
  --cbt-student-card-border: #1e293b;
  --cbt-student-text:        #e2e8f0; /* Soft White Slate anti-silau */
  --cbt-student-text-muted:  #94a3b8;
  --cbt-student-topbar-bg:   #060911; /* Ultra Deep Header */
  --cbt-student-bottombar-bg:#111c2e;
  --cbt-student-bottombar-border: #1e293b;

  /* Opsi Jawaban (Dark) */
  --cbt-option-bg:           #162238;
  --cbt-option-border:       #233554;
  --cbt-option-text:         #cbd5e1;
  --cbt-option-badge-bg:     #1e293b;
  --cbt-option-badge-text:   #94a3b8;
  --cbt-option-sel-bg:       #064e3b; /* Emerald Deep */
  --cbt-option-sel-border:   #10b981;
  --cbt-option-sel-text:     #a7f3d0;
  --cbt-option-sel-badge-bg: #10b981;
  --cbt-option-sel-badge-text: #ffffff;

  /* Navigasi Sebelumnya (Dark) */
  --cbt-btn-prev-bg:         #1e293b;
  --cbt-btn-prev-border:     #334155;
  --cbt-btn-prev-text:       #cbd5e1;

  /* Kisi-kisi Nomor Soal (Dark) */
  --cbt-no-idle:             #1e293b;
  --cbt-no-idle-text:        #94a3b8;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--cbt-student-bg);
  color: var(--cbt-student-text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* User Selection Prevention for Exam Security */
.prevent-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* =============================================================================
   LAYAR 1: LOBI TUNGGU & GERBANG MASUK
   ============================================================================= */
.lobby-header-bar {
  background: linear-gradient(135deg, var(--cbt-student-navy) 0%, #1e293b 100%);
  color: #ffffff;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lobby-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  width: 100%;
}

.card-student-id {
  background: var(--cbt-student-card);
  border-radius: var(--cbt-radius-mobile);
  border: 1px solid var(--cbt-student-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-exam-active {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border-radius: var(--cbt-radius-mobile);
  border: 2px solid #bbf7d0;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Kartu Naskah Soal Lobi (Feed Mapel) */
.card-lobby-exam {
  background: var(--cbt-student-card);
  border-radius: var(--cbt-radius-mobile);
  border: 1.5px solid var(--cbt-student-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.card-lobby-exam:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-lobby-exam.ready {
  border-left: 5px solid #10b981;
}

.card-lobby-exam.completed {
  border-left: 5px solid #94a3b8;
  background: #f8fafc;
  opacity: 0.88;
}

.btn-select-exam {
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  background-color: #10b981;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  width: 100%;
  cursor: pointer;
}

.btn-select-exam:hover:not(:disabled) {
  background-color: #059669;
  transform: translateY(-1px);
}

.token-input-box {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-align: center;
  border: 2px solid #cbd5e1;
  border-radius: var(--cbt-radius-mobile);
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  width: 100%;
}

.token-input-box:focus {
  outline: none;
  border-color: var(--cbt-student-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.token-input-box.mulai:focus {
  border-color: var(--cbt-token-mulai-border);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.token-input-box.kirim:focus {
  border-color: var(--cbt-token-kirim-border);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

/* Tombol Aksi Utama Jempol */
.btn-cbt-primary {
  min-height: var(--cbt-btn-min-height);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--cbt-radius-mobile);
  background-color: var(--cbt-student-blue);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  width: 100%;
  cursor: pointer;
}

.btn-cbt-primary:hover:not(:disabled) {
  background-color: var(--cbt-student-blue-hover);
  transform: translateY(-1px);
}

.btn-cbt-primary:disabled,
.btn-cbt-success:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(25%);
}

.btn-cbt-success {
  min-height: var(--cbt-btn-min-height);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--cbt-radius-mobile);
  background-color: #10b981;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  width: 100%;
  cursor: pointer;
}

.btn-cbt-success:hover:not(:disabled) {
  background-color: #059669;
}

/* =============================================================================
   LAYAR 2: BILIK PENGERJAAN SOAL (OFFLINE WORKSPACE)
   ============================================================================= */

/* Sticky Top Bar (Tinggi 58px) */
.exam-sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: var(--cbt-student-topbar-bg);
  color: #ffffff;
  padding: 0.65rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Area Konten Soal */
.exam-workspace {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem; /* bottom padding untuk sticky footer */
  width: 100%;
  flex: 1;
}

.card-question-box {
  background: var(--cbt-student-card);
  border-radius: var(--cbt-radius-mobile);
  border: 1px solid var(--cbt-student-card-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.question-text {
  font-size: var(--cbt-font-soal-size);
  line-height: 1.6;
  color: var(--cbt-student-text);
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.question-image-wrapper {
  margin: 1rem 0;
  text-align: center;
}

.question-image {
  max-width: 100%;
  max-height: 380px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: zoom-in;
  object-fit: contain;
}

/* Kartu Opsi Jawaban Vertikal (A, B, C, D, E) */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-card-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  min-height: var(--cbt-btn-min-height);
  border-radius: var(--cbt-radius-mobile);
  border: 1.5px solid var(--cbt-option-border);
  background-color: var(--cbt-option-bg);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease-in-out;
  position: relative;
  user-select: none;
}

.option-card-btn:active {
  transform: scale(0.99);
}

.option-letter-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background-color: var(--cbt-option-badge-bg);
  color: var(--cbt-option-badge-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.option-text-content {
  font-size: var(--cbt-font-opsi-size);
  color: var(--cbt-option-text);
  line-height: 1.45;
  flex: 1;
  word-break: break-word;
}

/* State Opsi Terpilih (Hijau Emerald) */
.option-card-btn.selected {
  border-color: var(--cbt-option-sel-border);
  background-color: var(--cbt-option-sel-bg);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.option-card-btn.selected .option-letter-badge {
  background-color: var(--cbt-option-sel-badge-bg);
  color: var(--cbt-option-sel-badge-text);
}

.option-card-btn.selected .option-text-content {
  font-weight: 600;
  color: var(--cbt-option-sel-text);
}

/* Sticky Bottom Bar (Tinggi 64px) */
.exam-sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  background-color: var(--cbt-student-bottombar-bg);
  border-top: 1px solid var(--cbt-student-bottombar-border);
  padding: 0.65rem 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.bottom-nav-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-nav-action {
  min-height: 48px;
  padding: 0.5rem 1rem;
  border-radius: var(--cbt-radius-mobile);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn-nav-prev {
  background-color: var(--cbt-btn-prev-bg);
  color: var(--cbt-btn-prev-text);
  border-color: var(--cbt-btn-prev-border);
}

.btn-nav-doubt {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.btn-nav-doubt.active {
  background-color: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
}

.btn-nav-next {
  background-color: var(--cbt-student-blue);
  color: #ffffff;
}

.btn-nav-finish {
  background-color: #10b981;
  color: #ffffff;
}

/* =============================================================================
   RESPONSIF BILIK UJIAN MOBILE: BERBAGI TEMPAT DENGAN MENU KONTROL (FAB ANDROID)
   Doktrin Bang Erwin: Tombol navigasi bergeser ke kiri, proporsional, dan
   menyediakan alokasi ruang lapang di kanan untuk FAB Menu Kontrol Android
   ============================================================================= */
@media (max-width: 768px) {
  .exam-sticky-bottom {
    padding: 0.5rem 0.65rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
  }

  .bottom-nav-inner {
    /* Alokasikan ruang di kanan untuk FAB Menu Kontrol Siswa Android (56dp + margin 20dp = ~76-80px) */
    padding-right: 82px;
    gap: 0.4rem;
    justify-content: flex-start;
  }

  .btn-nav-action {
    min-height: 44px;
    padding: 0.45rem 0.5rem;
    font-size: 0.84rem;
    border-radius: 10px;
    flex: 1 1 0px;
    min-width: 0;
    max-width: 125px;
    gap: 0.3rem;
  }

  .btn-nav-action i {
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .bottom-nav-inner {
    padding-right: 76px;
    gap: 0.25rem;
  }

  .btn-nav-action {
    padding: 0.4rem 0.3rem;
    font-size: 0.76rem;
    gap: 0.2rem;
    border-radius: 8px;
  }

  .btn-nav-action i {
    font-size: 0.82rem;
  }
}

/* =============================================================================
   DRAWER KISI-KISI SOAL (OFFCANVAS GRID)
   ============================================================================= */
.grid-questions-drawer {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  padding: 1rem;
}

@media (min-width: 576px) {
  .grid-questions-drawer {
    grid-template-columns: repeat(8, 1fr);
  }
}

.grid-num-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--cbt-student-card-border);
  background-color: var(--cbt-no-idle);
  color: var(--cbt-no-idle-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grid-num-btn.answered {
  background-color: var(--cbt-no-answered);
  color: #ffffff;
  border-color: #059669;
}

.grid-num-btn.doubt {
  background-color: var(--cbt-no-doubt);
  color: #ffffff;
  border-color: #d97706;
}

.grid-num-btn.current {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  transform: scale(1.06);
}

/* =============================================================================
   LAYAR 5: BUKTI PENYERAHAN RESMI (OFFICIAL HANDSHAKE)
   ============================================================================= */
.card-receipt-box {
  background: var(--cbt-student-card);
  border-radius: 16px;
  border: 1px solid var(--cbt-student-card-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 540px;
  margin: 2rem auto;
}

.success-check-icon {
  width: 72px;
  height: 72px;
  background-color: #dcfce7;
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.25rem;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.receipt-code-pill {
  font-family: 'Consolas', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  display: inline-block;
  margin: 0.75rem 0;
}

/* Offline Retry Alert Banner */
.offline-retry-alert {
  background-color: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: var(--cbt-radius-mobile);
  padding: 1rem;
  margin: 1.25rem 0;
  text-align: left;
}


/* Tipografi Khusus Naskah Arab (PAI) & KaTeX */
.arabic-text, [dir="rtl"], .text-arabic {
  font-family: 'Amiri', serif !important;
  font-size: 1.25rem;
  line-height: 2;
  direction: rtl;
  text-align: right;
}
.katex {
  font-size: 1.08em !important;
}

/* =============================================================================
   LAYAR PORTAL: GERBANG PEMILIH TINGKAT KELAS (100DVH ZERO-SCROLL)
   PANDUAN: dokumen/PetaArsitektur/gerbangSIswaUI.md
   ============================================================================= */
#screen-portal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px 16px;
  box-sizing: border-box;
}
#screen-portal.d-none {
  display: none !important;
}

.portal-wrapper {
  width: 100%;
  max-width: 410px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-sizing: border-box;
}
.portal-header {
  text-align: center;
  margin-bottom: 2px;
}
.portal-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin-bottom: 4px;
}
.portal-school-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
}
.portal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0b192c;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.portal-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0;
}
.portal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  width: 100%;
  margin: 12px 0 14px 0;
}
.portal-divider::before, .portal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 2px solid #cbd5e1;
}
.portal-divider-badge {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 5px 18px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
  margin: 0 10px;
}
.portal-buttons-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.grade-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 16px;
  color: #ffffff !important;
  min-height: 68px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.grade-btn:active {
  transform: scale(0.975);
}
.grade-btn-icon {
  font-size: 1.85rem;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  flex-shrink: 0;
}
.grade-btn-text {
  flex: 1;
}
.grade-btn-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.grade-btn-desc {
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.92;
  margin-top: 2px;
}
.grade-btn-arrow {
  font-size: 1.15rem;
  opacity: 0.75;
  flex-shrink: 0;
}
.btn-grade-x {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 6px 16px -3px rgba(16, 185, 129, 0.4);
}
.btn-grade-xi {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  box-shadow: 0 6px 16px -3px rgba(245, 158, 11, 0.4);
}
.btn-grade-xii {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  box-shadow: 0 6px 16px -3px rgba(99, 102, 241, 0.4);
}
.portal-footer {
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  padding-top: 4px;
}
.portal-footer strong {
  color: #475569;
}

/* =============================================================================
   FASILITAS ZOOM IN UKURAN TEKS SOAL (FONT SIZE ZOOM CONTROLLER)
   ============================================================================= */
body.font-zoom-medium {
  --cbt-font-soal-size: 1.20rem;
  --cbt-font-opsi-size: 1.08rem;
}

body.font-zoom-large {
  --cbt-font-soal-size: 1.38rem;
  --cbt-font-opsi-size: 1.22rem;
}

/* Skala Rumus Eksak KaTeX & Teks Arab saat Font Zoom Aktif */
body.font-zoom-medium .card-question-box .katex {
  font-size: 1.18em;
}
body.font-zoom-large .card-question-box .katex {
  font-size: 1.36em;
}

body.font-zoom-medium .card-question-box .arabic-text {
  font-size: 1.45rem;
  line-height: 2.1;
}
body.font-zoom-large .card-question-box .arabic-text {
  font-size: 1.75rem;
  line-height: 2.3;
}

/* Active State pada Pilihan Dropdown Zoom */
.btn-font-size-opt.active {
  background-color: #f1f5f9;
  font-weight: 700;
}

/* =============================================================================
   MODAL INTERAKTIF SUPER-DETAIL ZOOM GAMBAR SOAL (GEN-2)
   ============================================================================= */
.cbt-zoom-lightbox-content {
  background-color: rgba(11, 25, 44, 0.96) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cbt-zoom-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.cbt-zoom-hint {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  pointer-events: auto;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.cbt-btn-close-zoom {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.cbt-btn-close-zoom:active {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(0.92);
}

.cbt-zoom-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none; /* Cegah default browser scroll agar gesture sentuh mulus */
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.cbt-zoom-viewport.is-dragging {
  cursor: grabbing;
}

.cbt-zoom-target-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
}

.cbt-zoom-target-image.smooth-transition {
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}

/* Floating Action Toolbar Bawah */
.cbt-zoom-floating-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1060;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 32px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.btn-zoom-tool {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoom-tool:active {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0.9);
}

.btn-zoom-level-badge {
  width: auto;
  min-width: 58px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.14);
}

/* =============================================================================
   PENGATURAN TEMA MALAM (OLED EYE-CARE) & PROTEKSI KONTEN
   PANDUAN: dokumen/PetaArsitektur/siswaUI.md (Bab 3)
   ============================================================================= */

/* 1. Canvas Matting Protection: Diagram PNG Garis Hitam Transparan tidak hilang di Dark Mode */
[data-theme="dark"] .question-image {
  background-color: #ffffff;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #475569;
}

/* 2. Rumus Eksak KaTeX & Teks Arab di Dark Mode */
[data-theme="dark"] .katex {
  color: #f1f5f9 !important;
}

/* 3. Perlindungan Kontras Tabel Soal di Dark Mode */
[data-theme="dark"] .card-question-box table {
  color: var(--cbt-student-text) !important;
  border-color: var(--cbt-student-card-border) !important;
}
[data-theme="dark"] .card-question-box table th,
[data-theme="dark"] .card-question-box table td {
  border-color: var(--cbt-student-card-border) !important;
}
[data-theme="dark"] .card-question-box hr {
  border-color: var(--cbt-student-card-border) !important;
}

/* 4. Normalisasi Utilitas Teks & Background Bootstrap di Dark Mode */
[data-theme="dark"] .text-dark {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}
[data-theme="dark"] .bg-light {
  background-color: var(--cbt-student-bg) !important;
}
[data-theme="dark"] .bg-white {
  background-color: var(--cbt-student-card) !important;
}

/* 5. Tombol Ragu-Ragu Khusus Dark Mode */
[data-theme="dark"] .btn-nav-doubt {
  background-color: #451a03;
  color: #fde68a;
  border-color: #b45309;
}
[data-theme="dark"] .btn-nav-doubt.active {
  background-color: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
}

/* 6. Kartu Lobi, Token Input & Badge di Dark Mode */
[data-theme="dark"] .token-input-box {
  background-color: #162238;
  border-color: #334155;
  color: #f8fafc;
}
[data-theme="dark"] .token-input-box:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}
[data-theme="dark"] .receipt-code-pill {
  background-color: #162238;
  color: #38bdf8;
  border-color: #334155;
}

/* 7. Dropdown Menu & Modals di Dark Mode */
[data-theme="dark"] .dropdown-menu {
  background-color: #111c2e;
  border: 1px solid #1e293b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .dropdown-header {
  color: #94a3b8 !important;
}
[data-theme="dark"] .dropdown-item {
  color: #cbd5e1;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background-color: #1e293b;
  color: #ffffff;
}
[data-theme="dark"] .btn-font-size-opt.active {
  background-color: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .modal-content {
  background-color: #111c2e;
  border: 1px solid #1e293b;
  color: #e2e8f0;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: #1e293b;
}
[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}


