:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #243044;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --border: #dbe3ef;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container, main, .app-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

section, .card, .panel, .summary-section, .mode-selection-section, .config-section, .quiz-section, .results-section, .review-section, .history-section, .validation-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.25;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 3px solid #7dd3fc;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

p {
  color: var(--muted);
}

/* ===== LANDING PAGE POLISH ===== */

/* Header Improvements */
.header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  margin-bottom: 24px;
  text-align: center;
}

.header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.header .subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.header .disclaimer {
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  color: #854d0e;
  border-radius: 12px;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Loading Section Improvements */
.loading-section {
  text-align: center;
}

.loading-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px 20px;
}

.loading-status.loaded {
  padding: 20px;
  background: var(--success-soft);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  color: #166534;
}

.loading-status.loaded .spinner {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mode Selection Improvements */
.mode-selection-section h2 {
  text-align: center;
  margin-bottom: 32px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.mode-card {
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.mode-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.mode-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
}

.mode-card .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.mode-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.mode-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.main-actions {
  display: flex;
  justify-content: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.main-actions button {
  min-width: 200px;
  font-size: 1rem;
}

/* Summary Section Improvements */
.summary-section h2 {
  text-align: center;
  margin-bottom: 32px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.summary-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.summary-card .count {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--success);
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.summary-card .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.summary-card .status {
  display: inline-flex;
  align-items: center;
  background: var(--success-soft);
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.summary-card.tmk {
  border-left: 4px solid #7c3aed;
}

/* Total Summary Improvements */
.total-summary {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.total-summary h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: white;
}

.total-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.total-item {
  text-align: center;
}

.total-item .number {
  font-size: 3rem;
  font-weight: 800;
  display: block;
  line-height: 1;
  margin-bottom: 8px;
  color: white;
}

.total-item .label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

/* Validation Section Improvements */
.validation-section {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.validation-section h2 {
  text-align: center;
  margin-bottom: 20px;
}

.validation-section p {
  text-align: center;
  margin-bottom: 20px;
  color: var(--muted);
}

.command-box {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 1rem;
  text-align: center;
  position: relative;
}

.command-box::before {
  content: '$';
  color: #22c55e;
  margin-right: 8px;
  font-weight: bold;
}

.validation-section button {
  display: block;
  margin: 20px auto 0;
  min-width: 220px;
}

/* Footer Improvements */
.footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  font-size: 0.9rem;
}

/* Responsive Improvements */
@media (max-width: 900px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .total-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  .total-item .number {
    font-size: 2.5rem;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 24px 20px;
  }
  
  .header h1 {
    font-size: 2.5rem;
  }
  
  .mode-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .total-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .total-item .number {
    font-size: 3rem;
  }
  
  .main-actions button {
    width: 100%;
  }
}

button, .btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary, .secondary {
  background: #64748b;
}

.btn-danger, .danger {
  background: var(--danger);
}

.btn-success, .success {
  background: var(--success);
}

input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  background: white;
}

input:focus, select:focus, button:focus {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.mode-grid, .modes-grid, .category-grid, .subcategory-grid, .summary-grid, .stats-grid, .history-grid {
  display: grid;
  gap: 18px;
}

.mode-grid, .modes-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.category-grid, .subcategory-grid, .summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mode-card, .subcategory-card, .subcategory-option, .category-card, .summary-card, .stat-card, .history-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mode-card:hover, .subcategory-card:hover, .subcategory-option:hover, .category-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.mode-card.active, .mode-card.selected, .subcategory-card.active, .subcategory-card.selected, .subcategory-option.active, .subcategory-option.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.mode-card {
  min-height: 170px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mode-card .icon, .mode-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.summary-card .number, .stat-number, .count {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--success);
  display: block;
}

.total-summary, .total-card {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  padding: 26px;
  margin-top: 24px;
}

.total-summary *, .total-card * {
  color: white;
}

.error, .error-message {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
}

.success-message {
  background: var(--success-soft);
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
}

/* ===== QUIZ UI POLISH ===== */

/* Quiz Layout */
.quiz-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  margin-bottom: 24px;
}

/* Quiz Header */
.quiz-header {
  background: var(--primary);
  color: white;
  border-bottom: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.quiz-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  margin: 0 0 20px 0;
  border: none;
  padding: 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.quiz-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.quiz-progress {
  flex: 1;
  min-width: 300px;
}

.quiz-progress #progress-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 12px;
  text-align: center;
}

.progress-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.progress-stats .stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.progress-stats .stat.answered {
  color: #dcfce7;
  font-weight: 600;
}

.progress-stats .stat.unanswered {
  color: #fecaca;
  font-weight: 600;
}

/* Progress Bar */
.progress-bar-container {
  margin-top: 16px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.progress-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 6px;
  transition: width 0.4s ease;
  width: 0%;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Timer Styling */
.quiz-timer {
  display: flex;
  align-items: center;
}

.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 140px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.timer-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 4px;
}

.timer-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  font-family: 'Courier New', monospace;
  line-height: 1;
  letter-spacing: 1px;
}

.timer-display.timer-warning {
  border-color: var(--warning);
  background: var(--warning-soft);
  animation: pulse-warning 2s infinite;
}

.timer-display.timer-warning .timer-text {
  color: #854d0e;
}

.timer-display.timer-critical {
  border-color: var(--danger);
  background: var(--danger-soft);
  animation: pulse-critical 1s infinite;
}

.timer-display.timer-critical .timer-text {
  color: #991b1b;
}

@keyframes pulse-warning {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2); }
  50% { transform: scale(1.02); box-shadow: 0 6px 25px rgba(245, 158, 11, 0.3); }
}

@keyframes pulse-critical {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5); }
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  align-items: center;
}

.btn-danger-small {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.btn-danger-small:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Quiz Content Layout */
.quiz-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  min-height: 700px;
}

/* Question Panel */
.question-panel {
  padding: 32px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.current-question {
  margin-bottom: 40px;
}

/* Question Header */
.question-header {
  margin-bottom: 24px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.question-meta .badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-id {
  background: var(--muted);
  color: white;
}

.question-category {
  background: var(--primary);
  color: white;
}

.question-subcategory {
  background: #0891b2;
  color: white;
}

.question-level {
  color: white;
  font-weight: 800;
}

.question-level.mudah {
  background: var(--success);
}

.question-level.sedang {
  background: var(--warning);
  color: #854d0e;
}

.question-level.sulit {
  background: var(--danger);
}

/* Question Content */
.question-content {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.question-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Answer Options */
.answer-options {
  display: grid;
  gap: 16px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.answer-option:hover {
  border-color: var(--primary);
  background: #f8fbff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.answer-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.answer-option input[type="radio"] {
  display: none;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--muted);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-option.selected .option-letter {
  background: var(--primary);
  transform: scale(1.15);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.option-text {
  flex: 1;
  line-height: 1.6;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
}

/* Quiz Navigation */
.quiz-navigation {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.nav-btn {
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.nav-btn.btn-secondary {
  background: var(--muted);
  color: white;
}

.nav-btn.btn-secondary:hover:not(:disabled) {
  background: #475569;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
}

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

.nav-btn.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

#finish-btn {
  background: var(--danger);
  margin-left: auto;
  font-weight: 800;
  padding: 14px 28px;
}

#finish-btn:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
}

/* Question Numbers Panel */
.question-numbers-panel {
  background: var(--surface-soft);
  padding: 24px;
  position: sticky;
  top: 20px;
  height: fit-content;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.question-numbers-panel h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px 0;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* Question Numbers Grid */
.question-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.question-number-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.question-number-btn:hover {
  border-color: var(--primary);
  background: #f8fbff;
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.question-number-btn.current {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  transform: scale(1.05);
}

.question-number-btn.answered {
  border-color: var(--success);
  background: var(--success-soft);
  color: #166534;
  font-weight: 800;
}

.question-number-btn.answered.current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Legend */
.question-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  font-size: 0.85rem;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-color.active {
  background: var(--primary);
  border-color: var(--primary);
}

.legend-color.answered {
  background: var(--success-soft);
  border-color: var(--success);
}

.legend-color.unanswered {
  background: white;
}

/* Timer Expired Message */
.timer-expired-message {
  background: var(--warning-soft);
  border: 2px solid var(--warning);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  color: #854d0e;
  font-weight: 700;
  text-align: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

/* Responsive Design for Quiz */
@media (max-width: 1200px) {
  .quiz-content {
    grid-template-columns: 1fr 280px;
  }
  
  .question-numbers {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .question-number-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 1024px) {
  .quiz-content {
    grid-template-columns: 1fr 260px;
  }
  
  .question-panel {
    padding: 24px;
  }
  
  .question-content {
    padding: 24px;
  }
  
  .quiz-header {
    padding: 20px;
  }
  
  .quiz-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 900px) {
  .quiz-content {
    grid-template-columns: 1fr;
  }
  
  .question-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    order: 1;
  }
  
  .question-numbers-panel {
    position: static;
    max-height: none;
    order: 2;
    border-left: none;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
  }
  
  .quiz-info {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  
  .quiz-progress {
    min-width: auto;
  }
  
  .progress-stats {
    justify-content: space-around;
  }
  
  .timer-display {
    align-self: center;
    min-width: 160px;
  }
}

@media (max-width: 768px) {
  .quiz-header {
    padding: 16px 20px;
  }
  
  .quiz-header h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
  
  .question-panel {
    padding: 20px;
  }
  
  .question-content {
    padding: 20px;
  }
  
  .quiz-navigation {
    flex-direction: column;
    gap: 12px;
  }
  
  .nav-btn {
    width: 100%;
    padding: 16px 24px;
  }
  
  .question-numbers {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .question-number-btn {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  
  .answer-option {
    padding: 16px;
  }
  
  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .option-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .quiz-header {
    padding: 16px;
  }
  
  .quiz-header h2 {
    font-size: 1.3rem;
  }
  
  .question-panel {
    padding: 16px;
  }
  
  .question-content {
    padding: 16px;
  }
  
  .question-numbers {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .question-number-btn {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
  
  .answer-option {
    padding: 12px;
    gap: 12px;
  }
  
  .option-letter {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .option-text {
    font-size: 0.95rem;
  }
  
  .question-text {
    font-size: 1.05rem;
  }
  
  .progress-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .progress-stats .stat {
    justify-content: center;
  }
  
  .timer-display {
    min-width: 140px;
  }
}

.results-grid, .score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.result-card, .score-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.review-question, .review-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  padding: 22px;
  margin-bottom: 18px;
}

.review-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.review-option.user-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.review-filter, .filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.review-filter button, .filter-buttons button {
  background: #e2e8f0;
  color: var(--text);
}

.review-filter button.active, .filter-buttons button.active {
  background: var(--primary);
  color: white;
}

.explanation, .option-explanations, .quick-method {
  background: var(--surface-soft);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}

.history-card {
  display: grid;
  gap: 10px;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

@media (max-width: 900px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }
  
  .quiz-sidebar,
  .question-nav-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .container,
  main,
  .app-container {
    padding: 14px;
  }
  
  section,
  .card,
  .panel {
    padding: 18px;
  }
  
  .mode-grid,
  .modes-grid,
  .category-grid,
  .subcategory-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .quiz-actions,
  .navigation-buttons,
  .result-actions,
  .review-actions,
  .history-actions {
    flex-direction: column;
  }
  
  button,
  .btn {
    width: 100%;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }
  
  button,
  .mode-selection-section,
  .config-section,
  .validation-section,
  .history-section,
  .quiz-actions,
  .navigation-buttons,
  .result-actions,
  .review-actions,
  .no-print {
    display: none !important;
  }
  
  section,
  .card,
  .panel {
    box-shadow: none;
    border: 1px solid #999;
  }
}

/* ===== CONFIGURATION PANEL STYLING ===== */

/* Configuration Groups */
.config-group {
  margin-bottom: 24px;
}

.config-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 1rem;
}

.config-group p {
  color: var(--muted);
  margin-bottom: 16px;
}

/* Subcategory Options Styling */
.subcategory-option {
  cursor: pointer;
  text-align: left;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subcategory-option h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.subcategory-option p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 12px 0;
  flex: 1;
}

.subcategory-option .count {
  display: inline-flex;
  align-items: center;
  background: var(--muted);
  color: white;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.subcategory-option.selected .count {
  background: var(--primary);
}

/* Subcategory Grid */
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

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

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

/* Config Actions */
.config-actions {
  margin-top: 32px;
  text-align: center;
}

.config-actions button {
  min-width: 200px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
}
/* ===== HISTORY PAGE STYLING ===== */

/* History Page Header */
.history-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.history-page-header h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  border: none;
  padding: 0;
}

.history-page-header button {
  min-width: 180px;
}

/* History Stats Grid */
.history-stats {
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

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

.stats-details {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-details p {
  margin: 0 0 8px 0;
}

.stats-details p:last-child {
  margin-bottom: 0;
}

.stats-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* History Actions */
.history-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: flex-start;
}

.history-actions button {
  min-width: 160px;
}

/* History List */
.history-list {
  display: grid;
  gap: 16px;
}

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.history-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.history-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-date .date {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.history-date .time {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-mode {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-item-content {
  margin-bottom: 16px;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.history-summary .summary-item {
  text-align: center;
}

.history-summary .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.history-summary .value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.history-summary .value.correct {
  color: var(--success);
}

.history-summary .value.wrong {
  color: var(--danger);
}

.history-summary .value.empty {
  color: var(--warning);
}

.history-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
  min-width: auto;
}

.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.history-empty p {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* Responsive History */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .history-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .history-page-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .history-page-header button {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .history-actions {
    flex-direction: column;
  }
  
  .history-actions button {
    width: 100%;
  }
  
  .history-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .history-item-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .history-item-actions {
    flex-direction: column;
  }
  
  .history-item-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .history-summary {
    grid-template-columns: 1fr;
  }
  
  .history-summary .summary-item {
    padding: 12px;
    background: var(--surface-soft);
    border-radius: 8px;
  }
}
/* ===== RESULTS PAGE STYLING ===== */

/* Results Dashboard */
.results-dashboard {
  max-width: 900px;
  margin: 0 auto;
}

.results-header {
  text-align: center;
  margin-bottom: 40px;
}

.results-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px 0;
  border: none;
  padding: 0;
}

.results-disclaimer {
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
  color: #854d0e;
  font-weight: 600;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Main Score Display */
.score-display {
  text-align: center;
  margin-bottom: 40px;
}

.main-score {
  background: var(--primary);
  color: white;
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
  max-width: 400px;
  margin: 0 auto;
}

.score-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.9;
}

.score-value {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.score-subtitle {
  font-size: 1rem;
  opacity: 0.8;
}

/* Results Stats */
.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--muted);
}

.stat-card.correct::before {
  background: var(--success);
}

.stat-card.wrong::before {
  background: var(--danger);
}

.stat-card.empty::before {
  background: var(--warning);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.1);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.stat-card.correct .stat-icon {
  color: var(--success);
}

.stat-card.wrong .stat-icon {
  color: var(--danger);
}

.stat-card.empty .stat-icon {
  color: var(--warning);
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--text);
}

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

/* Mixed Score Breakdown */
.score-breakdown {
  margin-bottom: 40px;
}

.score-breakdown h3 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.breakdown-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.breakdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.breakdown-item.tpk::before {
  background: var(--primary);
}

.breakdown-item.tmk::before {
  background: #7c3aed;
}

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

.breakdown-type {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.breakdown-count {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 4px 8px;
  border-radius: 12px;
}

.breakdown-score {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.breakdown-detail {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Results Actions */
.results-actions {
  text-align: center;
}

.primary-actions {
  margin-bottom: 24px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 250px;
}

.secondary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.secondary-actions button {
  min-width: 160px;
}

/* ===== REVIEW PAGE STYLING ===== */

/* Review Dashboard */
.review-dashboard {
  max-width: 1000px;
  margin: 0 auto;
}

/* Review Header */
.review-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.review-title h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  border: none;
  padding: 0;
}

.btn-back {
  min-width: 160px;
}

/* Review Summary Compact */
.review-summary-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.summary-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.summary-stat.correct::before {
  background: var(--success);
}

.summary-stat.wrong::before {
  background: var(--danger);
}

.summary-stat.empty::before {
  background: var(--warning);
}

.summary-stat.total::before {
  background: var(--primary);
}

.summary-stat .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

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

/* Filter Segmented Control */
.review-filters {
  margin-bottom: 32px;
}

.filter-segmented {
  display: flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  max-width: 600px;
  margin: 0 auto;
}

.filter-segment {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.filter-segment:hover {
  background: rgba(37, 99, 235, 0.1);
}

.filter-segment.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.filter-count {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 500;
}

/* Review Questions */
.review-questions {
  display: grid;
  gap: 24px;
}

.review-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.review-question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.review-question-card.correct::before {
  background: var(--success);
}

.review-question-card.wrong::before {
  background: var(--danger);
}

.review-question-card.empty::before {
  background: var(--warning);
}

.review-question-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.1);
}

/* Question Card Header */
.question-card-header {
  background: var(--surface-soft);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.question-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.question-meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-badge.id {
  background: var(--muted);
  color: white;
}

.meta-badge.category {
  background: var(--primary);
  color: white;
}

.meta-badge.subcategory {
  background: #0891b2;
  color: white;
}

.meta-badge.level {
  color: white;
}

.meta-badge.level-mudah {
  background: var(--success);
}

.meta-badge.level-sedang {
  background: var(--warning);
  color: #854d0e;
}

.meta-badge.level-sulit {
  background: var(--danger);
}

/* Question Status Badge */
.question-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.question-status-badge.status-correct {
  background: var(--success-soft);
  color: #166534;
  border: 1px solid var(--success);
}

.question-status-badge.status-wrong {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid var(--danger);
}

.question-status-badge.status-empty {
  background: var(--warning-soft);
  color: #854d0e;
  border: 1px solid var(--warning);
}

.status-icon {
  font-size: 1rem;
}

/* Question Card Content */
.question-card-content {
  padding: 24px;
}

.question-text-review {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 24px;
  font-weight: 500;
}

.question-image-review {
  margin-bottom: 24px;
  text-align: center;
}

.question-image-review img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Answer Options Review */
.answer-options-review {
  margin-bottom: 24px;
}

.review-option-card {
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.review-option-card.correct-answer {
  border-color: var(--success);
  background: var(--success-soft);
}

.review-option-card.user-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.review-option-card.user-correct {
  border-color: var(--success);
  background: var(--success-soft);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.option-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.option-letter-review {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--muted);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.review-option-card.correct-answer .option-letter-review {
  background: var(--success);
}

.review-option-card.user-wrong .option-letter-review {
  background: var(--danger);
}

.option-text-review {
  flex: 1;
  line-height: 1.5;
  color: var(--text);
  font-size: 1rem;
}

.option-indicators {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.option-indicator {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.option-indicator.correct {
  background: var(--success);
  color: white;
}

.option-indicator.user-wrong {
  background: var(--danger);
  color: white;
}

.option-indicator.user-correct {
  background: var(--success);
  color: white;
}

/* Answer Summary Card */
.answer-summary-review {
  margin-bottom: 24px;
}

.answer-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.answer-summary-card.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.answer-summary-card.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.answer-summary-card.empty {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.summary-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.answer-summary-card.correct .summary-icon {
  color: var(--success);
}

.answer-summary-card.wrong .summary-icon {
  color: var(--danger);
}

.answer-summary-card.empty .summary-icon {
  color: var(--warning);
}

.summary-content {
  flex: 1;
}

.summary-status {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.answer-summary-card.correct .summary-status {
  color: #166534;
}

.answer-summary-card.wrong .summary-status {
  color: #991b1b;
}

.answer-summary-card.empty .summary-status {
  color: #854d0e;
}

.summary-detail {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Explanation Sections */
.explanation-sections {
  display: grid;
  gap: 20px;
}

.explanation-main,
.option-explanations,
.quick-method {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.explanation-sections h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explanation-content,
.quick-method-content {
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}

.explanations-grid {
  display: grid;
  gap: 12px;
}

.option-explanation {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.option-explanation.correct-option {
  border-color: var(--success);
  background: var(--success-soft);
}

.option-letter-exp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--muted);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.option-explanation.correct-option .option-letter-exp {
  background: var(--success);
}

.option-explanation-text {
  flex: 1;
  line-height: 1.5;
  color: var(--text);
  font-size: 0.9rem;
}

/* Review Actions */
.review-actions {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Responsive Results & Review */
@media (max-width: 768px) {
  .results-stats {
    grid-template-columns: 1fr;
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
  
  .secondary-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .secondary-actions button {
    width: 100%;
    max-width: 300px;
  }
  
  .review-title {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .btn-back {
    width: 100%;
  }
  
  .review-summary-compact {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-segmented {
    flex-direction: column;
  }
  
  .question-card-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .answer-summary-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .results-header h2 {
    font-size: 2rem;
  }
  
  .score-value {
    font-size: 3rem;
  }
  
  .review-summary-compact {
    grid-template-columns: 1fr;
  }
  
  .question-meta-badges {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print Styles for Results */
@media print {
  .results-actions,
  .review-actions,
  .filter-segmented,
  .btn-back,
  .no-print {
    display: none !important;
  }
  
  .results-dashboard,
  .review-dashboard {
    max-width: none;
  }
  
  .review-question-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .explanation-sections {
    break-inside: avoid;
  }
}

/* ===== HISTORY DETAIL PAGE STYLING ===== */

/* History Detail Header */
.history-detail-header {
  margin-bottom: 32px;
}

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

.detail-header-content h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.detail-back-btn {
  min-width: 180px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

.meta-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.detail-disclaimer {
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  color: #854d0e;
  border-radius: 12px;
  padding: 16px 20px;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Summary Cards Grid */
.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.summary-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.summary-card.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.summary-card.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.summary-card.empty {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.summary-card.total {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.card-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.summary-card.correct .card-number {
  color: var(--success);
}

.summary-card.wrong .card-number {
  color: var(--danger);
}

.summary-card.empty .card-number {
  color: var(--warning);
}

.summary-card.total .card-number {
  color: var(--primary);
}

.card-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Score Cards Grid */
.score-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.score-cards-grid.single {
  grid-template-columns: 1fr;
  max-width: 300px;
  margin: 20px auto 0;
}

.score-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.score-card.tpk {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.score-card.tmk {
  border-color: var(--success);
  background: var(--success-soft);
}

.score-card.total {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.score-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.score-value.large {
  font-size: 3rem;
}

.score-card.tpk .score-value {
  color: var(--primary);
}

.score-card.tmk .score-value {
  color: var(--success);
}

.score-card.total .score-value {
  color: var(--warning);
}

.score-detail {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

/* Answer Cards */
.answers-cards {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.answer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.answer-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.answer-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.answer-number {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  min-width: 50px;
  text-align: center;
}

.answer-id {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'Courier New', monospace;
}

.answer-status-badge {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.answer-status-badge.correct {
  background: var(--success);
  color: white;
}

.answer-status-badge.wrong {
  background: var(--danger);
  color: white;
}

.answer-status-badge.empty {
  background: var(--warning);
  color: white;
}

.answer-card-content {
  padding: 20px;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.answer-category {
  font-weight: 600;
  color: var(--text);
}

.answer-subcategory {
  font-weight: 500;
}

.answer-level {
  font-weight: 500;
  background: var(--surface-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.answer-separator {
  color: var(--border);
}

.answer-details {
  display: grid;
  gap: 12px;
}

.answer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.answer-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.answer-value {
  font-size: 1rem;
  font-weight: 700;
}

.answer-value.answered {
  color: var(--text);
}

.answer-value.not-answered {
  color: var(--muted);
  font-style: italic;
}

.answer-value.correct-answer {
  color: var(--success);
  background: var(--success-soft);
  padding: 4px 8px;
  border-radius: 6px;
}

/* History Detail Actions */
.history-detail-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.history-detail-actions button {
  min-width: 200px;
}

/* Responsive History Detail */
@media (max-width: 1024px) {
  .summary-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .score-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .detail-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .detail-header-content {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .detail-back-btn {
    width: 100%;
  }
  
  .summary-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .score-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .score-cards-grid.single {
    max-width: none;
  }
  
  .detail-meta {
    grid-template-columns: 1fr;
  }
  
  .answer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .history-detail-actions {
    flex-direction: column;
  }
  
  .history-detail-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .summary-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .answer-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .answer-status-badge {
    margin-left: 0;
    order: -1;
    width: 100%;
    text-align: center;
  }
}
/* ===== PROGRESS SECTION STYLING ===== */

/* Progress Section */
.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.progress-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 3px solid #10b981;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

/* Progress Overview */
.progress-overview {
  display: grid;
  gap: 24px;
}

.progress-summary {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.progress-main {
  display: grid;
  gap: 20px;
}

.progress-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.progress-item {
  text-align: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
}

.progress-item.total {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.progress-item.seen {
  border-color: var(--success);
  background: var(--success-soft);
}

.progress-item.unseen {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.progress-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.progress-item.total .progress-number {
  color: var(--primary);
}

.progress-item.seen .progress-number {
  color: var(--success);
}

.progress-item.unseen .progress-number {
  color: var(--warning);
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Progress Bar */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar {
  flex: 1;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-percentage {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success);
  min-width: 50px;
  text-align: right;
}

/* Progress Breakdown */
.progress-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.progress-breakdown h4 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.progress-breakdown h5 {
  margin: 16px 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

/* Category Progress */
.category-progress {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.category-item {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.category-item.tpk {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.category-item.tmk {
  background: var(--success-soft);
  border-color: var(--success);
}

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

.category-name {
  font-weight: 700;
  font-size: 1rem;
}

.category-item.tpk .category-name {
  color: var(--primary);
}

.category-item.tmk .category-name {
  color: var(--success);
}

.category-stats {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.category-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.category-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.category-item.tpk .category-fill {
  background: var(--primary);
}

.category-item.tmk .category-fill {
  background: var(--success);
}

/* Subcategory Progress */
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.subcategory-item {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.subcategory-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.subcategory-stats {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.subcategory-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.subcategory-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ai-question-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) minmax(96px, 0.6fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
}

.ai-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ai-field select,
.ai-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
}

.ai-question-panel .btn-primary {
  min-height: 44px;
  white-space: nowrap;
}

/* Progress Actions */
.progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.progress-actions button {
  min-width: 200px;
}

/* Responsive Progress */
@media (max-width: 1024px) {
  .progress-numbers {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .subcategory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .progress-bar-container {
    flex-direction: column;
    gap: 12px;
  }
  
  .progress-percentage {
    text-align: center;
    min-width: auto;
  }
  
  .category-header {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
  
  .progress-actions {
    flex-direction: column;
  }
  
  .progress-actions button {
    width: 100%;
  }

  .ai-question-panel {
    grid-template-columns: 1fr;
  }

  .ai-question-panel .btn-primary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .progress-numbers {
    grid-template-columns: 1fr;
  }
  
  .subcategory-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== UNSEEN QUESTIONS OPTION STYLING ===== */

/* Subcategory Info */
.subcategory-info {
  margin-top: 16px;
  padding: 0;
  background: transparent;
  border: none;
}

.subcategory-stats-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

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

.stats-icon {
  font-size: 1.2rem;
}

.stats-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat-item.total {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.stat-item.unseen {
  border-color: var(--success);
  background: var(--success-soft);
}

.stat-item.seen {
  border-color: var(--muted);
  background: var(--surface);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* Unseen Priority Section */
.unseen-priority-section {
  margin-top: 0;
}

.unseen-priority-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

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

.priority-icon {
  font-size: 1.2rem;
}

.priority-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.priority-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.priority-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.priority-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.priority-description {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin-left: 30px;
}

/* Legacy styles for backward compatibility */
.subcategory-stats h5 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-item.unseen .stat-number {
  color: var(--success);
}

.stat-item.seen .stat-number {
  color: var(--muted);
}

/* Checkbox styling improvements */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkbox-label span {
  flex: 1;
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-item {
    padding: 10px;
  }
  
  .stat-number {
    font-size: 1.3rem;
  }
  
  .priority-description {
    margin-left: 0;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ===== LANDING REFRESH ===== */

body {
  background:
    linear-gradient(90deg, rgba(219, 234, 254, 0.55) 1px, transparent 1px),
    linear-gradient(180deg, rgba(219, 234, 254, 0.5) 1px, transparent 1px),
    #eef4f8;
  background-size: 44px 44px;
}

.container {
  max-width: 1240px;
  padding: 28px;
}

.main {
  padding-top: 0;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: 36px;
  min-height: 460px;
  overflow: hidden;
  position: relative;
  padding: 44px;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(37, 99, 235, 0.1), transparent 42%),
    linear-gradient(0deg, rgba(20, 184, 166, 0.09), transparent 38%);
  pointer-events: none;
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-kicker::before {
  content: "";
  width: 34px;
  height: 3px;
  background: #0f766e;
  border-radius: 999px;
}

.landing-hero h1 {
  max-width: 720px;
  margin: 0 0 14px;
  color: #172033;
  font-size: clamp(2.8rem, 6vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.landing-hero .subtitle {
  max-width: 680px;
  margin: 0 0 26px;
  color: #475569;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hero-actions a:hover {
  transform: translateY(-1px);
}

.hero-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

.hero-secondary {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.landing-hero .disclaimer {
  max-width: 640px;
  margin: 0;
  border-radius: 8px;
  background: #fff7ed;
  border-color: #fed7aa;
  color: #7c2d12;
  text-align: left;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 16px;
  align-items: end;
}

.hero-screen {
  min-height: 330px;
  padding: 18px;
  background: #102033;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}

.screen-topbar {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.screen-topbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
}

.screen-topbar span:nth-child(2) {
  background: #f59e0b;
}

.screen-topbar span:nth-child(3) {
  background: #22c55e;
}

.screen-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.screen-status > div,
.screen-question {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.08);
  padding: 14px;
}

.screen-label {
  display: block;
  color: #93a4b8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.screen-status strong {
  color: #ffffff;
  font-size: 1.06rem;
}

.screen-question {
  min-height: 105px;
  margin-bottom: 14px;
}

.question-pill {
  display: inline-flex;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}

.question-line {
  height: 10px;
  width: 68%;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #dbeafe;
}

.question-line.wide {
  width: 92%;
}

.screen-options {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.screen-options span {
  display: block;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.1);
}

.screen-options span:nth-child(3) {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.16);
}

.screen-progress {
  display: flex;
  gap: 8px;
}

.screen-progress span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(219, 234, 254, 0.16);
}

.screen-progress .active {
  background: #38bdf8;
}

.hero-stat-stack {
  display: grid;
  gap: 12px;
}

.hero-stat {
  min-height: 120px;
  border-radius: 8px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.hero-stat strong {
  display: block;
  color: #2563eb;
  font-size: 2.6rem;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 8px;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.loading-section,
.mode-selection-section,
.summary-section,
.progress-section,
.validation-section {
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.loading-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  text-align: left;
}

.loading-section h2,
.mode-selection-section h2,
.summary-section h2,
.progress-section h2,
.validation-section h2 {
  border: 0;
  padding-bottom: 0;
  letter-spacing: 0;
}

.loading-section h2 {
  margin-bottom: 0;
}

.loading-status.loaded {
  align-items: flex-start;
  border-radius: 8px;
  margin: 0;
}

.mode-selection-section {
  background: #ffffff;
}

.mode-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  min-height: 210px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  text-align: left;
  justify-content: flex-start;
}

.mode-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 6px;
  border-radius: 999px;
  background: #7dd3fc;
  opacity: 0.75;
}

.mode-card .icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e0f2fe;
  font-size: 1.9rem;
}

.mode-card h3 {
  font-size: 1.12rem;
}

.mode-card:hover,
.mode-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.14);
}

.main-actions {
  justify-content: flex-end;
}

.summary-card,
.progress-summary,
.progress-breakdown,
.subcategory-item,
.category-item,
.stat-item {
  border-radius: 8px;
}

.summary-card {
  text-align: left;
  border-left-width: 6px;
}

.summary-card .status {
  border-radius: 999px;
}

.total-summary {
  border-radius: 8px;
  background: #12325c;
}

.validation-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.validation-section h2,
.validation-section p,
.validation-section .command-box,
.validation-section button {
  margin: 0;
}

.validation-section p {
  text-align: left;
}

.validation-section button {
  min-width: 190px;
}

@media (max-width: 1100px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 720px;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .validation-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 16px;
  }

  .landing-hero {
    min-height: auto;
    gap: 18px;
    padding: 28px 20px 22px;
  }

  .landing-hero h1 {
    font-size: clamp(2.35rem, 13vw, 3.4rem);
    line-height: 1;
  }

  .landing-hero .subtitle {
    margin-bottom: 20px;
    font-size: 1rem;
  }

  .hero-actions a {
    width: 100%;
  }

  .hero-visual {
    display: block;
  }

  .hero-stat-stack {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .hero-stat {
    min-height: 86px;
    padding: 14px;
  }

  .hero-stat strong {
    font-size: 2.2rem;
  }

  .hero-screen {
    display: none;
  }

  .landing-hero .disclaimer {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .loading-section {
    gap: 10px;
    padding: 18px;
  }

  .loading-section,
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .main-actions {
    justify-content: stretch;
  }
}

/* ===== PROFESSIONAL UI REFRESH ===== */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --text: #172033;
  --muted: #667085;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --border: #e3e8ef;
  --shadow: 0 18px 44px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 8px 20px rgba(17, 24, 39, 0.05);
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(15, 118, 110, 0.08), transparent 26rem),
    linear-gradient(180deg, #f8fafc 0%, #edf3f8 100%);
  color: var(--text);
}

.container {
  max-width: 1220px;
  padding: 22px;
}

.app-topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #172033;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-mark strong,
.brand-mark small {
  display: block;
  line-height: 1.15;
}

.brand-mark strong {
  font-size: 0.98rem;
}

.brand-mark small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  padding: 0 13px;
  color: #475467;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.topbar-actions a:hover {
  background: #eef4ff;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.landing-hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  min-height: 520px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.94)),
    #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

.landing-hero::before {
  background:
    linear-gradient(125deg, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.11), transparent 42%);
}

.hero-kicker {
  color: var(--accent);
  letter-spacing: 0.14em;
}

.hero-kicker::before {
  background: var(--accent);
}

.landing-hero h1 {
  max-width: 740px;
  color: #101828;
  font-size: clamp(2.7rem, 6.5vw, 5.9rem);
  line-height: 0.98;
}

.landing-hero .subtitle {
  max-width: 650px;
  color: #475467;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: -8px 0 24px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 6px 11px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.hero-actions a,
button,
.btn-primary,
.btn-secondary,
.btn-danger {
  border-radius: 10px;
  font-weight: 850;
}

.btn-primary,
.hero-primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
}

.btn-secondary,
.hero-secondary {
  background: #ffffff;
  color: #172033;
  border: 1px solid #d0d7e2;
  box-shadow: var(--shadow-soft);
}

.btn-danger {
  background: #fff1f2;
  color: #b42318;
  border: 1px solid #fecdd3;
}

button:hover:not(:disabled),
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

.hero-secondary {
  background: #172033;
  color: #ffffff;
  border-color: #172033;
}

.landing-hero .disclaimer {
  border-radius: 10px;
  background: #fff7ed;
  border-color: #fed7aa;
  box-shadow: none;
}

.hero-screen {
  position: relative;
  min-height: 360px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(23, 32, 51, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.28);
  transform: perspective(1100px) rotateY(-5deg) rotateX(2deg);
  animation: uiFloat 7s ease-in-out infinite;
}

@keyframes uiFloat {
  0%, 100% {
    transform: perspective(1100px) rotateY(-5deg) rotateX(2deg) translateY(0);
  }
  50% {
    transform: perspective(1100px) rotateY(-3deg) rotateX(1deg) translateY(-8px);
  }
}

.screen-status > div,
.screen-question,
.screen-options span,
.screen-progress span {
  border-radius: 10px;
}

.hero-stat {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.insight-item {
  min-height: 130px;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.insight-label {
  display: inline-flex;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-item strong {
  display: block;
  color: #101828;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.1;
}

.insight-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.study-guide-section {
  display: grid;
  gap: 20px;
}

.section-heading {
  max-width: 780px;
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-bottom: 8px;
}

.section-heading p {
  margin: 0;
}

.guide-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-card {
  padding: 22px;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  background:
    linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-soft);
}

.guide-tag {
  display: inline-flex;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 900;
}

.guide-tag.tmk {
  background: #ecfdf5;
  color: #047857;
}

.guide-card h3,
.test-type-card h3 {
  margin: 0 0 8px;
  color: #101828;
}

.guide-card p,
.test-type-card p {
  margin: 0;
}

.guide-card ul {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: #475467;
}

.guide-card li {
  padding-left: 2px;
}

.test-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.test-type-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.test-type-card strong,
.test-type-card span {
  display: block;
}

.test-type-card strong {
  margin-top: 16px;
  color: #172033;
  font-size: 0.9rem;
}

.test-type-card span {
  margin-top: 4px;
  color: #475467;
  font-size: 0.92rem;
  line-height: 1.5;
}

section,
.session-restore-section,
.mode-selection-section,
.config-section,
.session-summary-section,
.summary-section,
.progress-section,
.history-section,
.history-detail-section,
.validation-section,
.loading-section {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.loading-section,
.validation-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr);
  align-items: center;
}

.validation-section {
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1fr) auto;
}

h2 {
  color: #101828;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  border-bottom: 0;
  padding-bottom: 0;
}

.mode-grid,
.summary-grid,
.subcategory-grid,
.history-list,
.summary-cards-grid {
  gap: 14px;
}

.mode-card,
.summary-card,
.subcategory-card,
.subcategory-option,
.category-card,
.history-card,
.history-item,
.answer-card,
.question-card,
.answer-summary-card,
.stat-card {
  border-radius: 12px;
  border-color: #e3e8ef;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.mode-card {
  min-height: 220px;
  padding: 24px;
}

.mode-card:hover,
.mode-card.selected,
.subcategory-card:hover,
.subcategory-card.selected,
.subcategory-option:hover,
.subcategory-option.selected,
.category-card:hover,
.category-card.selected {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.13);
}

.mode-card .icon,
.mode-icon {
  border-radius: 12px;
  background: #eef4ff;
}

.summary-card {
  border-left-width: 4px;
}

.total-summary {
  background:
    linear-gradient(135deg, #172033, #12325c);
  border-radius: 14px;
}

.progress-overview {
  gap: 18px;
}

.progress-summary,
.progress-breakdown,
.category-item,
.subcategory-item {
  border-color: #e3e8ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.progress-number,
.progress-percentage,
.summary-card .count,
.stat-number {
  color: #1d4ed8;
}

.progress-fill,
.category-fill,
.subcategory-fill {
  background: linear-gradient(90deg, #2563eb, #0f766e);
}

.ai-question-panel {
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.35fr) minmax(92px, 0.55fr) auto;
  gap: 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, #f8fbff, #ffffff);
  box-shadow: var(--shadow-soft);
}

.ai-question-panel.is-generating {
  border-color: rgba(37, 99, 235, 0.35);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), #ffffff);
}

.ai-generation-status {
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.ai-generation-status strong,
.ai-generation-status span {
  display: block;
}

.ai-generation-status strong {
  color: #172033;
  font-size: 0.98rem;
}

.ai-generation-status span {
  margin-top: 2px;
  color: #475467;
  font-size: 0.9rem;
  font-weight: 700;
}

.ai-loader,
.btn-loader {
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563eb;
  animation: spin 0.75s linear infinite;
}

.ai-loader {
  width: 34px;
  height: 34px;
}

.btn-loader {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.ai-question-panel .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ai-field select,
.ai-field input,
input,
select,
textarea {
  border-radius: 10px;
  border-color: #d0d7e2;
  background: #ffffff;
}

.ai-field select:focus,
.ai-field input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
  backdrop-filter: blur(16px);
}

.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 900;
}

.toast-body strong,
.toast-body span {
  display: block;
}

.toast-body strong {
  color: #101828;
  line-height: 1.25;
}

.toast-body span {
  margin-top: 3px;
  color: #475467;
  font-size: 0.92rem;
  line-height: 1.45;
}

.toast-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  box-shadow: none;
}

.toast-close:hover {
  background: #f2f4f7;
}

.toast-success {
  border-color: #bbf7d0;
}

.toast-success .toast-icon {
  background: #dcfce7;
  color: #15803d;
}

.toast-error {
  border-color: #fecdd3;
}

.toast-error .toast-icon {
  background: #fee2e2;
  color: #b42318;
}

.toast-warning {
  border-color: #fed7aa;
}

.toast-warning .toast-icon {
  background: #ffedd5;
  color: #c2410c;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.confirm-modal.is-open {
  display: flex;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(8px);
}

.confirm-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid #e3e8ef;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  transform: translateY(0);
}

.confirm-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fee2e2;
  color: #b42318;
  font-size: 1.2rem;
  font-weight: 900;
}

.confirm-info .confirm-icon {
  background: #eef4ff;
  color: #1d4ed8;
}

.confirm-content h3 {
  margin: 0 0 8px;
  color: #101828;
  font-size: 1.25rem;
}

.confirm-content p {
  margin: 0;
  color: #475467;
  line-height: 1.55;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.no-timer-option {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 850;
}

.duration-hint {
  display: block;
  margin-top: 8px;
  color: #475467;
}

.custom-duration-option:has(input:disabled) {
  opacity: 0.58;
}

.quiz-header,
.question-container,
.navigation-panel,
.results-container,
.review-container {
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.question-text {
  color: #101828;
}

.option-label,
.answer-option,
.option-item {
  border-radius: 12px;
}

.footer {
  color: #667085;
  padding: 18px 0 32px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1100px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .hero-screen {
    transform: none;
    animation: none;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .guide-overview,
  .test-type-grid {
    grid-template-columns: 1fr;
  }

  .validation-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 14px;
  }

  .app-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar-actions a {
    justify-content: center;
    padding: 0 8px;
  }

  .landing-hero {
    min-height: auto;
    padding: 24px 18px;
  }

  .hero-badges span {
    flex: 1 1 auto;
    justify-content: center;
  }

  .hero-visual {
    display: block;
  }

  .hero-screen {
    display: none;
  }

  .hero-stat-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loading-section,
  .validation-section,
  .ai-question-panel {
    grid-template-columns: 1fr;
  }

  .validation-section button,
  .ai-question-panel .btn-primary {
    width: 100%;
  }

  .toast-container {
    right: 14px;
    bottom: 14px;
  }

  .confirm-dialog {
    grid-template-columns: 1fr;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .landing-hero h1 {
    font-size: clamp(2.35rem, 14vw, 3.2rem);
  }

  section,
  .session-restore-section,
  .mode-selection-section,
  .config-section,
  .session-summary-section,
  .summary-section,
  .progress-section,
  .history-section,
  .history-detail-section,
  .validation-section,
  .loading-section {
    padding: 18px;
  }
}

/* ===== PROFESSIONAL QUIZ WORKSPACE ===== */

body.quiz-active {
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
}

body.quiz-active .app-topbar,
body.quiz-active .landing-hero,
body.quiz-active .insight-strip,
body.quiz-active .loading-section,
body.quiz-active .study-guide-section,
body.quiz-active .mode-selection-section,
body.quiz-active .config-section,
body.quiz-active .session-summary-section,
body.quiz-active .summary-section,
body.quiz-active .validation-section,
body.quiz-active .developer-panel,
body.quiz-active .progress-section,
body.quiz-active .footer {
  display: none !important;
}

body.quiz-active .container,
body.quiz-active .main {
  max-width: none;
  width: 100%;
  padding: 0;
}

body.quiz-active .main {
  min-height: 100vh;
}

body.quiz-active .quiz-section {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
  box-shadow: none;
}

body.quiz-active .quiz-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 16px clamp(18px, 4vw, 42px);
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.quiz-title-block {
  min-width: 0;
}

.quiz-kicker {
  display: inline-flex;
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.quiz-active .quiz-header h2 {
  margin: 0;
  color: #101828;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

body.quiz-active .quiz-info {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

body.quiz-active .quiz-progress {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body.quiz-active #progress-text {
  color: #172033;
  font-size: 0.95rem;
  font-weight: 900;
}

body.quiz-active .progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.quiz-active .progress-stats .stat {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f2f4f7;
  color: #475467;
  font-size: 0.82rem;
  font-weight: 850;
}

body.quiz-active .progress-stats .answered {
  background: #ecfdf3;
  color: #047857;
}

body.quiz-active .progress-stats .unanswered {
  background: #fff7ed;
  color: #c2410c;
}

body.quiz-active .quiz-progress .progress-bar-container {
  height: 8px;
  margin: 0;
  background: transparent;
}

body.quiz-active .quiz-progress .progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e5eaf1;
  overflow: hidden;
}

body.quiz-active .progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0f766e);
}

body.quiz-active .timer-display {
  min-width: 132px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 10px 14px;
  background: #eff6ff;
  box-shadow: none;
}

body.quiz-active .timer-label {
  color: #475467;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.quiz-active .timer-text {
  color: #1d4ed8;
  font-size: 1.2rem;
  font-weight: 950;
}

body.quiz-active .quiz-actions {
  display: flex;
  justify-content: flex-end;
}

body.quiz-active .btn-danger-small {
  min-height: 42px;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 9px 13px;
  background: #fff1f2;
  color: #b42318;
  font-weight: 900;
}

body.quiz-active .quiz-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 42px) 42px;
  align-items: start;
}

body.quiz-active .question-panel,
body.quiz-active .question-numbers-panel {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

body.quiz-active .question-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: calc(100vh - 150px);
  overflow: hidden;
}

body.quiz-active .current-question {
  padding: clamp(22px, 4vw, 42px);
}

body.quiz-active .question-header {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 0 18px;
  border-bottom: 1px solid #eef2f7;
}

.question-number-label {
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.quiz-active .question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.quiz-active .badge {
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

body.quiz-active .question-id {
  background: #f2f4f7;
  color: #475467;
}

body.quiz-active .question-category {
  background: #eef4ff;
  color: #1d4ed8;
}

body.quiz-active .question-subcategory {
  background: #ecfdf5;
  color: #047857;
}

body.quiz-active .question-level {
  background: #fff7ed;
  color: #c2410c;
}

body.quiz-active .question-text {
  max-width: 940px;
  margin-bottom: 26px;
  color: #101828;
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.75;
  font-weight: 650;
}

body.quiz-active .answer-options {
  display: grid;
  gap: 12px;
}

body.quiz-active .answer-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  min-height: 66px;
  padding: 15px;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.quiz-active .answer-option:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.09);
}

body.quiz-active .answer-option.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.13);
}

body.quiz-active .option-letter {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f2f4f7;
  color: #475467;
  font-weight: 950;
}

body.quiz-active .answer-option.selected .option-letter {
  background: #2563eb;
  color: #ffffff;
}

body.quiz-active .option-text {
  color: #172033;
  font-size: 1rem;
  line-height: 1.65;
}

body.quiz-active .quiz-navigation {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  padding: 16px clamp(22px, 4vw, 42px);
  border-top: 1px solid #eef2f7;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

body.quiz-active .nav-btn {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 950;
}

body.quiz-active .question-numbers-panel {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 18px;
}

.question-numbers-header span {
  display: inline-flex;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.quiz-active .question-numbers-panel h3 {
  margin: 4px 0 16px;
  color: #101828;
  font-size: 1.15rem;
}

body.quiz-active .question-numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

body.quiz-active .question-number-btn {
  aspect-ratio: 1;
  min-height: 42px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #ffffff;
  color: #475467;
  font-weight: 950;
  box-shadow: none;
}

body.quiz-active .question-number-btn.current {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

body.quiz-active .question-number-btn.answered:not(.current) {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #15803d;
}

body.quiz-active .question-legend {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
}

body.quiz-active .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 1080px) {
  body.quiz-active .quiz-header {
    grid-template-columns: 1fr;
  }

  body.quiz-active .quiz-info {
    grid-template-columns: 1fr auto;
  }

  body.quiz-active .quiz-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body.quiz-active .quiz-content {
    grid-template-columns: 1fr;
  }

  body.quiz-active .question-numbers-panel {
    position: static;
    max-height: none;
  }

  body.quiz-active .question-numbers {
    grid-template-columns: repeat(10, minmax(42px, 1fr));
  }
}

@media (max-width: 680px) {
  body.quiz-active .quiz-header {
    padding: 14px;
  }

  body.quiz-active .quiz-info {
    grid-template-columns: 1fr;
  }

  body.quiz-active .timer-display {
    width: 100%;
  }

  body.quiz-active .quiz-content {
    padding: 14px;
  }

  body.quiz-active .question-panel {
    min-height: auto;
  }

  body.quiz-active .current-question {
    padding: 20px 16px;
  }

  body.quiz-active .question-text {
    font-size: 1.02rem;
  }

  body.quiz-active .quiz-navigation {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  body.quiz-active .question-numbers {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.quiz-active .answer-option {
    grid-template-columns: auto 1fr;
    padding: 13px;
  }
}

/* ===== COMPACT PROFESSIONAL LANDING ===== */

.compact-guide,
.landing-panel-collapse,
.developer-panel {
  display: block;
  overflow: hidden;
  padding: 0;
}

.guide-summary,
.landing-panel-summary,
.developer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  cursor: pointer;
  list-style: none;
}

.guide-summary::-webkit-details-marker,
.landing-panel-summary::-webkit-details-marker,
.developer-summary::-webkit-details-marker {
  display: none;
}

.guide-summary .section-heading,
.landing-panel-summary .section-heading,
.developer-summary .section-heading {
  max-width: 860px;
}

.guide-summary h2,
.landing-panel-summary h2,
.developer-summary h2 {
  margin: 0 0 6px;
}

.guide-summary p,
.landing-panel-summary p,
.developer-summary p {
  margin: 0;
  color: var(--muted);
}

.summary-toggle,
.landing-panel-summary::after,
.developer-summary::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 42px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.summary-toggle::before {
  content: "Buka panduan";
}

.compact-guide[open] .summary-toggle::before {
  content: "Tutup";
}

.developer-summary::after {
  content: "Buka";
}

.landing-panel-summary::after {
  content: "Buka";
}

.landing-panel-collapse[open] .landing-panel-summary::after {
  content: "Tutup";
}

.developer-panel[open] .developer-summary::after {
  content: "Tutup";
}

.compact-guide .guide-overview,
.compact-guide .test-type-grid {
  padding: 0 22px 22px;
}

.landing-panel-content {
  display: grid;
  gap: 18px;
  padding: 0 22px 22px;
}

.compact-guide .test-type-grid {
  padding-top: 0;
}

.developer-panel-content {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 22px 22px;
}

.developer-panel-content p,
.developer-panel-content .command-box,
.developer-panel-content button {
  margin: 0;
}

.developer-panel-content button {
  min-width: 190px;
}

.compact-guide:not([open]) .guide-overview,
.compact-guide:not([open]) .test-type-grid,
.landing-panel-collapse:not([open]) .landing-panel-content,
.developer-panel:not([open]) .developer-panel-content {
  display: none;
}

@media (min-width: 900px) {
  .landing-hero {
    min-height: auto;
  }

  .hero-copy {
    padding-block: 8px;
  }

  .hero-screen {
    max-width: 440px;
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .guide-summary,
  .landing-panel-summary,
  .developer-summary,
  .developer-panel-content {
    grid-template-columns: 1fr;
  }

  .summary-toggle,
  .landing-panel-summary::after,
  .developer-summary::after,
  .developer-panel-content button {
    width: 100%;
  }
}

/* ===== INTERNAL PAGES ===== */

body.page-home .page-guide-content,
body.page-home .page-practice-content,
body.page-home .page-progress-content,
body.page-guide .page-home-content,
body.page-guide .page-practice-content,
body.page-guide .page-progress-content,
body.page-practice .page-home-content,
body.page-practice .page-guide-content,
body.page-practice .page-progress-content,
body.page-progress .page-home-content,
body.page-progress .page-guide-content,
body.page-progress .page-practice-content {
  display: none !important;
}

.topbar-actions a.is-active,
.topbar-actions a[aria-current="page"] {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

body.page-guide .study-guide-section,
body.page-progress .summary-section,
body.page-progress .progress-section {
  display: block;
}

body.page-guide .study-guide-section {
  padding: 0;
}

body.page-guide .guide-summary,
body.page-progress .landing-panel-summary {
  cursor: default;
}

body.page-guide .summary-toggle,
body.page-progress .landing-panel-summary::after {
  display: none;
}

body.page-guide .compact-guide .guide-overview,
body.page-guide .compact-guide .test-type-grid,
body.page-progress .landing-panel-content {
  display: grid;
}

@media (max-width: 760px) {
  .topbar-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}
