:root {
  --primary: #e59b22;
  --primary-hover: color-mix(in srgb, var(--primary) 85%, #000000);
  --primary-light: color-mix(in srgb, var(--primary) 12%, #ffffff);
  --primary-glow: color-mix(in srgb, var(--primary) 25%, transparent);
  --primary-soft-border: color-mix(in srgb, var(--primary) 35%, transparent);
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  /* Slate Neutral System */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Impeccable Elevation - Ambient Multi-layered Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 0 3.5px var(--primary-glow);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-spring: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Proteksi Anti-Cheat: Cegah seleksi teks */
.anti-cheat-protected {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Container Umum Mobile Viewport */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  position: relative;
  box-shadow: 0 0 35px rgba(15, 23, 42, 0.06);
}

/* Header Ujian Sticky dengan Glassmorphism (Impeccable Style) */
.exam-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.exam-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exam-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
  letter-spacing: -0.2px;
}

.exam-student {
  font-size: 0.74rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Timer Badge Minimalis & Tabular Figures */
.timer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #0f172a;
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.timer-badge.urgent {
  background-color: var(--danger);
  border-color: rgba(255, 255, 255, 0.2);
  animation: pulse 1s infinite;
}

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

/* Tombol Laci Nomor Soal */
.palette-toggle-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-soft-border);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.palette-toggle-btn:active {
  transform: scale(0.96);
}

/* Area Konten Soal */
.exam-body {
  flex: 1;
  padding: 18px 16px 110px 16px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.question-num-badge {
  display: inline-block;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  letter-spacing: 0.3px;
}

.question-status-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.2px;
}

.status-answered {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-unanswered {
  background-color: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.status-doubtful {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Teks Pertanyaan (Impeccable Typography) */
.question-text {
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--gray-900);
  margin-bottom: 22px;
  font-weight: 450;
  white-space: pre-wrap;
  word-break: break-word;
  text-wrap: pretty;
}

.question-text p {
  margin-bottom: 14px;
  line-height: 1.72;
}

.question-text p:last-child {
  margin-bottom: 0;
}

.question-text mark {
  background-color: #fef08a;
  color: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
}

.question-text u {
  text-decoration: underline;
  text-underline-offset: 3.5px;
}

.question-text code {
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  color: #c026d3;
  border: 1px solid var(--gray-200);
}

/* Pilihan Opsi Jawaban (A, B, C, D, E) - Tactile Feel */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition-spring);
  min-height: 54px;
  box-shadow: var(--shadow-xs);
  user-select: none;
}

.option-item:hover {
  border-color: var(--gray-300);
  background-color: var(--gray-50);
}

.option-item:active {
  transform: scale(0.985);
}

.option-item.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  background-color: var(--gray-100);
  color: var(--gray-700);
  flex-shrink: 0;
  transition: var(--transition-spring);
  border: 1px solid var(--gray-200);
}

.option-item.selected .option-letter {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.option-text {
  font-size: 0.94rem;
  color: var(--gray-800);
  padding-top: 3px;
  line-height: 1.5;
  word-break: break-word;
}

/* Navigasi Bawah Sticky dengan Glassmorphism */
.exam-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

/* Tombol (Buttons) - Tactile Press & Polish */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-spring);
  min-height: 44px;
  box-shadow: var(--shadow-xs);
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.975);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px var(--primary-glow);
}

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

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
  color: var(--gray-900);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Tombol Ragu-Ragu */
.doubtful-wrapper {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--warning);
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.doubtful-wrapper:active {
  transform: scale(0.97);
}

.doubtful-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--warning);
  cursor: pointer;
}

/* Bottom Sheet Laci Nomor Soal Modern */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  z-index: 70;
  padding: 16px 20px 32px 20px;
  transition: bottom 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.bottom-sheet.active {
  bottom: 0;
}

.sheet-handle {
  width: 42px;
  height: 4.5px;
  background-color: var(--gray-300);
  border-radius: var(--radius-pill);
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.sheet-close-btn {
  background: var(--gray-100);
  border: none;
  font-size: 1.2rem;
  color: var(--gray-600);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sheet-close-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.legend-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gray-600);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Grid Nomor Soal */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px 14px 2px;
}

.palette-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-xs);
}

.palette-btn:active {
  transform: scale(0.93);
}

.palette-btn.active {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
}

.palette-btn.answered {
  background-color: var(--success);
  color: #ffffff;
  border-color: var(--success);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.palette-btn.doubtful {
  background-color: var(--warning);
  color: #ffffff;
  border-color: var(--warning);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.palette-btn .chosen-sub {
  font-size: 0.58rem;
  font-weight: 800;
  opacity: 0.95;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  margin-top: 1px;
}

/* Modal Dialogs (Impeccable Glass Overlay & Depth) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overscroll-behavior: contain;
  animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.modal-open {
  overflow: hidden !important;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 26px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(15, 23, 42, 0.08);
  animation: scaleUpModal 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUpModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-danger {
  width: 56px;
  height: 56px;
  background: var(--danger-light);
  color: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px auto;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 20px;
  line-height: 1.55;
}

/* Indikator Status Simpan (Autosave Toast) */
.save-indicator {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.save-indicator.show {
  opacity: 1;
}

/* Styling Halaman Login / Auth */
.auth-page {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.4px;
}

.auth-subtitle {
  font-size: 0.84rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--gray-800);
  background: #ffffff;
  transition: var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Dashboard Guru Desktop & Tablet */
.admin-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-200);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 4px;
}

.table-responsive {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.88rem;
}

th, td {
  padding: 12px 16px;
}

th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 1.5px solid var(--gray-200);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

td {
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-green {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-yellow {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Card Surface Umum */
.card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

/* Segmented Control Pill Navigation */
.nav-btn {
  padding: 8px 18px;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.nav-btn:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.nav-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

/* ==================== SOAL TABEL MATRIKS (MATRIX QUESTION) ==================== */
.matrix-card {
  background: #ffffff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-spring);
}

.matrix-card.has-answer {
  border-color: var(--primary-soft-border);
  background: #fafaf9;
}

.matrix-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.matrix-card-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.matrix-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.matrix-card-badge-empty {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.matrix-card-statement {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--gray-900);
  font-weight: 500;
  margin-bottom: 12px;
}

.matrix-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.matrix-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 48px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--gray-700);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-xs);
}

.matrix-pill-btn:active {
  transform: scale(0.975);
}

.matrix-pill-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.matrix-pill-btn .pill-radio {
  font-size: 0.95rem;
  line-height: 1;
}

.matrix-pill-btn.selected .pill-radio {
  color: var(--primary);
}

.matrix-pill-btn .pill-text {
  word-break: break-word;
  text-align: center;
}

/* ==================== QUILL WYSIWYG & RICH TEXT FORMATTING ==================== */
/* Card Pembungkus Area Editor Soal */
.editor-card-container {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  margin-top: 6px;
  margin-bottom: 12px;
}

.editor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-card-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #bae6fd;
}

.editor-card-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Kotak Lembar Kertas Pengetikan (Canvas) */
.editor-canvas-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1.5px solid #cbd5e1;
  transition: all var(--duration-fast) var(--ease-spring);
  overflow: hidden;
}

.editor-canvas-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.editor-canvas-box .ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 8px 10px !important;
}

.editor-canvas-box .ql-container.ql-snow {
  border: none !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  background: #ffffff !important;
}

.ql-editor {
  min-height: 190px;
  max-height: 440px;
  overflow-y: auto;
  line-height: 1.65;
  padding: 14px 16px !important;
  color: var(--gray-900);
}

.ql-editor.ql-blank::before {
  color: var(--gray-400) !important;
  font-style: normal !important;
  font-weight: 400 !important;
}

/* Quill Toolbar Button Enhancements */
.ql-snow .ql-stroke {
  stroke: var(--gray-600) !important;
}
.ql-snow .ql-fill {
  fill: var(--gray-600) !important;
}
.ql-snow .ql-picker {
  color: var(--gray-700) !important;
  font-weight: 500 !important;
}
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--primary) !important;
}
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: var(--primary) !important;
}

/* Rich Text Alignment Helpers (for Student & Preview Rendering) */
.ql-align-center {
  text-align: center !important;
}
.ql-align-right {
  text-align: right !important;
}
.ql-align-justify {
  text-align: justify !important;
}

/* Responsive Image & Table inside Question Text */
.question-text img,
#newQPreviewBoxContent img,
#editQPreviewBoxContent img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 8px 0;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.question-text table,
#newQPreviewBoxContent table,
#editQPreviewBoxContent table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  border: 1px solid var(--gray-300);
}

.question-text table th,
.question-text table td,
#newQPreviewBoxContent table th,
#newQPreviewBoxContent table td,
#editQPreviewBoxContent table th,
#editQPreviewBoxContent table td {
  border: 1px solid var(--gray-300);
  padding: 8px 10px;
  font-size: 0.88rem;
}

.question-text table th,
#newQPreviewBoxContent table th,
#editQPreviewBoxContent table th {
  background: var(--gray-100);
  font-weight: 700;
}

/* ==========================================================================
   SUITE KEAMANAN & ANTI-SCREENSHOT (OPSI A: WEB-BASED SECURITY)
   ========================================================================== */

/* 1. Watermark Forensik Dinamis Identitas Siswa */
.exam-watermark {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 25;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  background-repeat: repeat;
  background-position: center;
}

/* 2. Tirai Layar Gelap Pengaman (Privacy Curtain) */
.screen-privacy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ffffff;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.privacy-content {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: privacyPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes privacyPop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.privacy-icon {
  font-size: 54px;
  margin-bottom: 14px;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.privacy-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.privacy-subtitle {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* 3. Proteksi Anti-Copy & Anti-Drag */
body.anti-cheat-protected {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

body.anti-cheat-protected img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

/* ==================== INTERACTIVE IMAGE ZOOM LIGHTBOX ==================== */
.image-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  animation: fadeInZoomModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInZoomModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.zoom-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  pointer-events: none;
}

.zoom-indicator {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.zoom-btn-close {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.zoom-btn-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 1);
  transform: scale(1.06);
}

.zoom-btn-close:active {
  transform: scale(0.94);
}

.zoom-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

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

.zoom-viewport img {
  max-width: 92vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  transform-origin: center center;
  will-change: transform;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.zoom-viewport img.no-transition {
  transition: none !important;
}

.zoom-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 20;
  pointer-events: none;
}

.zoom-controls-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.zoom-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.zoom-control-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.92);
}

.zoom-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.zoom-hint-text {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

/* Kursor Zoom untuk semua gambar di dalam soal dan opsi */
.question-text img,
.options-list img,
#matrixOptionsContainer img {
  cursor: zoom-in !important;
  border-radius: var(--radius-sm);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.question-text img:hover,
.options-list img:hover,
#matrixOptionsContainer img:hover {
  filter: brightness(1.04);
}

