/* ==========================================================================
   Banana Shake Theme - Clean Google Forms Aesthetic with Tactile Buttons
   ========================================================================== */

:root {
  /* Banana Shake Milk Palette */
  --bg-page: #FBF8F1;
  --bg-card: #FFFFFF;
  --bg-subtle: #FAF6EC;
  --bg-input: #FFFFFF;

  --border-light: #E7DECB;
  --border-subtle: #EFE8DA;
  --border-focus: #E5B810;

  /* Ripe Banana Yellows */
  --banana-100: #FFF9D2;
  --banana-200: #FEEF90;
  --banana-300: #FDE25A;
  --banana-400: #F5C518;
  --banana-500: #EDB70D;
  --banana-600: #C99505;
  --banana-700: #9E7400;
  --banana-900: #4B3302;

  /* Typography Colors */
  --text-primary: #261E14;
  --text-secondary: #453A2D;
  --text-muted: #8A7B69;

  /* Semantic Feedback */
  --correct-bg: #F0F9F2;
  --correct-border: #A3D9B1;
  --correct-text: #19582A;

  --incorrect-bg: #FDF2F2;
  --incorrect-border: #F5B8B8;
  --incorrect-text: #821D1D;

  /* Roundedness - moderate, not overly rounded */
  --radius-card: 12px;
  --radius-btn: 10px;
  --radius-sm: 6px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-top: 68px; /* Offset for fixed top header */
  padding-bottom: max(60px, env(safe-area-inset-bottom, 20px));
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #F8F5EC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13px;
  -webkit-overflow-scrolling: touch;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.9em;
  word-break: break-word;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0;
}

/* ==========================================================================
   Fixed Top Navigation (Frosted Glass Effect - Permanently Pinned)
   ========================================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: rgba(251, 248, 241, 0.88);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border-bottom: 1px solid rgba(228, 218, 198, 0.75);
  box-shadow: 0 4px 20px rgba(40, 30, 15, 0.05);
  padding: 10px 20px;
}

.top-nav-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-nav-actions {
  display: none;
}

body.quiz-active .top-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
  text-decoration: none;
}

.brand-text {
  white-space: nowrap;
}

.brand-text-short {
  display: none;
}

.brand-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF5CC 100%);
  border: 1.5px solid var(--text-primary);
  box-shadow: 0 2px 0 var(--text-primary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.brand-badge:hover .brand-star {
  transform: rotate(12deg) scale(1.08);
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-pills-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.student-pill {
  cursor: default;
}

.student-pill .pill-icon {
  font-size: 13px;
  line-height: 1;
}

.mode-pill {
  cursor: default;
}

.mode-pill .mode-icon {
  font-size: 13px;
  line-height: 1;
}

.stat-pill.score-pill {
  background: var(--banana-100);
  border-color: var(--banana-300);
  color: var(--banana-900);
}

.cloud-pill {
  font-size: 11.5px;
  color: var(--text-muted);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  cursor: default;
  transition: all 0.25s ease;
}

.cloud-pill.syncing {
  border-color: var(--banana-400);
  background: var(--banana-100);
  color: var(--banana-900);
}

.cloud-icon {
  font-size: 12px;
  line-height: 1;
}

/* ==========================================================================
   Landing External Footer (Outside Card)
   ========================================================================== */
.landing-external-footer {
  text-align: center;
  margin: 18px auto 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.admin-login-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  display: inline-block;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transition: color 0.15s ease;
}

.admin-login-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.admin-login-link:active {
  color: var(--banana-700);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.landing-credit-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Hide landing footer completely when quiz is active */
body.quiz-active .landing-external-footer,
body.quiz-active #landing-external-footer,
body.quiz-active #past-sessions-card,
body.quiz-active .past-sessions-card {
  display: none !important;
}

/* Past Sessions on Homescreen */
.past-sessions-card {
  padding: 20px 22px;
}

.past-session-item {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  transition: all 0.15s ease;
}

.past-session-item:hover {
  border-color: var(--border-focus);
  background: #FFFDF8;
}

.past-session-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.past-session-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.past-session-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.past-session-scores {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Uraian Structured Tables & Boxes */
.uraian-mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.84rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.uraian-mini-table th {
  background: var(--bg-subtle);
  padding: 8px 10px;
  font-weight: 800;
  color: var(--text-primary);
  border-bottom: 1.5px solid var(--border-light);
  text-align: left;
}

.uraian-mini-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.uraian-mini-table tr:last-child td {
  border-bottom: none;
}

.ans-filled {
  font-weight: 700;
  color: var(--text-primary);
}

.ans-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   Container & Cards (Google Forms Style)
   ========================================================================== */
.container {
  max-width: 760px;
  margin: 20px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(40, 30, 15, 0.05);
  position: relative;
  scroll-margin-top: 68px;
}

/* Header Card */
.header-card {
  overflow: hidden;
  border-top: none;
}

.header-accent-bar {
  height: 10px;
  background: linear-gradient(90deg, #F5C518 0%, #FEE066 100%);
}

.header-content {
  padding: 24px 28px;
}

.quiz-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.quiz-desc {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* Participant Gate Form */
.participant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.required-star {
  color: #D93838;
}

.form-input {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.18);
}

/* Class Multiple Choice Group */
.class-choice-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.class-choice-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  flex: 1;
  min-width: 70px;
  justify-content: center;
}

.class-choice-item:hover {
  background: var(--bg-subtle);
  border-color: #D6C8A8;
}

.class-radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.class-radio-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #C8BEAC;
  background: #FFFFFF;
  transition: all 0.12s ease;
  position: relative;
}

.class-choice-item:has(.class-radio-input:checked) {
  background: #FFFDF4;
  border-color: var(--banana-500);
  box-shadow: 0 1.5px 0 var(--banana-600);
}

.class-choice-item:has(.class-radio-input:checked) .class-radio-custom {
  border-color: var(--banana-600);
  background: var(--banana-400);
}

.class-choice-item:has(.class-radio-input:checked) .class-radio-custom::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #FFFFFF;
  border-radius: 50%;
}

.class-label-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Mode Selection Checkmark Card */
.mode-selection-wrapper {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
}

.mode-select-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.mode-select-card:hover {
  background: #FFFDF8;
  border-color: #D8CCA8;
}

.mode-checkbox-box {
  padding-top: 2px;
  flex-shrink: 0;
}

.mode-checkbox-input,
.mode-native-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-custom-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #C4B69E;
  background: #FFFFFF;
  color: transparent;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.08);
}

.mode-checkbox-input:checked + .mode-custom-check,
.mode-native-checkbox:checked + .mode-custom-check {
  background: var(--banana-400);
  border-color: var(--banana-600);
  color: #1A1200;
}

.mode-select-card:has(.mode-checkbox-input:checked) {
  background: #FFFDF5;
  border-color: var(--banana-400);
}

.mode-text-details {
  flex: 1;
}

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

.mode-main-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.mode-status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.mode-status-tag.tag-strict {
  background: #FEE8E8;
  color: #C5221F;
  border: 1px solid #F5C2C2;
}

.mode-status-tag.tag-practice {
  background: var(--banana-100);
  color: var(--banana-900);
  border: 1px solid var(--banana-300);
}

.mode-sub-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Locked states */
.choice-item.locked {
  pointer-events: none;
  cursor: default;
  opacity: 0.88;
}

.interactive-cell-input:disabled,
.essay-textarea:disabled,
.part-input:disabled {
  background: #FAF8F2 !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  border-color: #E2DAC8 !important;
}

.btn-locked {
  background: #ECE5D5 !important;
  border-color: #D2C6B0 !important;
  color: #8C7F6A !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.gate-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Tactile Skeuomorphic Buttons (Reference from Tweet)
   ========================================================================== */
.btn-tactile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease-in-out;
  outline: none;
  text-decoration: none;
}

/* Ripe Banana Tactile Button */
.btn-banana {
  background: linear-gradient(180deg, #FDE25A 0%, #EDB70D 100%);
  border: 1px solid #C49405;
  color: var(--banana-900);
  box-shadow: 
    0 3px 0 #9E7400,
    0 4px 10px rgba(158, 116, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn-banana:hover:not(:disabled) {
  background: linear-gradient(180deg, #FEE976 0%, #F5C118 100%);
  box-shadow: 
    0 4px 0 #9E7400,
    0 6px 14px rgba(158, 116, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-banana:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 
    0 1px 0 #9E7400,
    inset 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Cream Neutral Tactile Button */
.btn-cream {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5EEDD 100%);
  border: 1px solid #D6C8A8;
  color: var(--text-primary);
  box-shadow: 
    0 2px 0 #BFB08E,
    0 3px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn-cream:hover:not(:disabled) {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF3E6 100%);
  box-shadow: 0 3px 0 #BFB08E, 0 4px 8px rgba(0, 0, 0, 0.06);
}

.btn-cream:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #BFB08E;
}

.btn-tactile:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Filter Tabs
   ========================================================================== */
.filter-card {
  padding: 10px 16px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s ease;
}

.tab-btn:hover {
  background: var(--bg-subtle);
}

.tab-btn.active {
  background: var(--banana-300);
  border-color: var(--banana-600);
  color: var(--banana-900);
  font-weight: 700;
}

.tab-text-full {
  display: inline;
}

.tab-text-short {
  display: none;
}

/* ==========================================================================
   Question Stream & Cards (Google Forms Style)
   ========================================================================== */
#quiz-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.questions-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-num {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-primary);
}

.q-points {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.question-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
}

.question-body p {
  margin-bottom: 8px;
}

.question-body ol,
.question-body ul,
.feedback-content ol,
.feedback-content ul {
  padding-left: 24px;
  margin: 8px 0 12px 0;
}

.question-body li,
.feedback-content li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.question-body li::marker,
.feedback-content li::marker {
  color: var(--text-primary);
  font-weight: 700;
}

.question-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  margin: 12px 0;
  display: block;
}

/* Markdown Tables */
.question-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.question-body th, .question-body td {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  text-align: left;
}

.question-body th {
  background: var(--bg-subtle);
  font-weight: 700;
}

/* ==========================================================================
   Multiple Choice Options (Google Forms Style Radio Items)
   ========================================================================== */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.choice-item:hover {
  background: var(--bg-subtle);
  border-color: #D6C8A8;
}

.choice-item.selected {
  background: #FFFDF4;
  border-color: var(--banana-500);
}

.choice-item.correct-revealed {
  background: var(--correct-bg);
  border-color: var(--correct-border);
}

.choice-item.wrong-revealed {
  background: var(--incorrect-bg);
  border-color: var(--incorrect-border);
  opacity: 0.85;
}

/* Radio circle */
.choice-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #C8BEAC;
  background: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.12s ease;
}

.choice-item.selected .choice-radio {
  border-color: var(--banana-600);
  background: var(--banana-400);
  color: var(--banana-900);
}

.choice-item.correct-revealed .choice-radio {
  border-color: #2E8540;
  background: #2E8540;
  color: #FFFFFF;
}

.choice-item.wrong-revealed .choice-radio {
  border-color: #D93838;
  background: #D93838;
  color: #FFFFFF;
}

.choice-text {
  font-size: 14.5px;
  color: var(--text-primary);
  flex: 1;
}

/* ==========================================================================
   Question Action Bar & Verification Feedback
   ========================================================================== */
.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.feedback-box {
  margin-top: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  display: none;
  animation: fadeIn 0.2s ease;
}

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

.feedback-box.correct {
  display: block;
  background: var(--correct-bg);
  border: 1px solid var(--correct-border);
  color: var(--correct-text);
}

.feedback-box.wrong {
  display: block;
  background: var(--incorrect-bg);
  border: 1px solid var(--incorrect-border);
  color: var(--incorrect-text);
}

.feedback-box.partial {
  display: block;
  background: var(--banana-100);
  border: 1px solid var(--banana-300);
  color: var(--banana-900);
}

.feedback-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.feedback-content {
  font-size: 13.5px;
  line-height: 1.6;
}

/* ==========================================================================
   Uraian Inputs
   ========================================================================== */
.essay-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.essay-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.18);
}

.multi-part-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.part-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.part-prompt {
  font-weight: 600;
  font-size: 13.5px;
}

.part-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.part-input {
  max-width: 280px;
}

/* ==========================================================================
   Interactive Table for Uraian (Soal 4 & Soal 5)
   ========================================================================== */
.interactive-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 14px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  box-shadow: 0 1.5px 4px rgba(40, 30, 15, 0.04);
}

.interactive-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.interactive-table th {
  background: #FDF9EE;
  border-bottom: 2px solid var(--border-light);
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
}

.interactive-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.interactive-table tr:last-child td {
  border-bottom: none;
}

.interactive-table tr:hover td {
  background: #FFFEFA;
}

.interactive-cell-input {
  width: 100%;
  min-width: 125px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13.5px;
  border: 1.5px solid var(--border-light);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--text-primary);
  transition: all 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

.interactive-cell-input:focus {
  border-color: var(--banana-500);
  background: #FFFDF5;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.2);
}

.interactive-cell-input.input-correct {
  border-color: var(--correct-border);
  background: var(--correct-bg);
}

.interactive-cell-input.input-partial {
  border-color: var(--banana-500);
  background: var(--banana-100);
}

.interactive-cell-input.input-wrong {
  border-color: var(--incorrect-border);
  background: var(--incorrect-bg);
}

.row-status-cell {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  min-width: 120px;
}

.row-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.row-badge.correct {
  background: var(--correct-bg);
  color: var(--correct-text);
  border: 1px solid var(--correct-border);
}

.row-badge.partial {
  background: var(--banana-100);
  color: var(--banana-900);
  border: 1px solid var(--banana-400);
}

.row-badge.wrong {
  background: var(--incorrect-bg);
  color: var(--incorrect-text);
  border: 1px solid var(--incorrect-border);
}

/* Submit Card */
.submit-card {
  padding: 0;
  margin-top: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF6 100%);
  border-color: var(--banana-300);
  box-shadow: 0 3px 0 rgba(158, 116, 0, 0.10), 0 8px 20px rgba(40, 30, 15, 0.05);
}

.submit-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 14px;
}

.submit-card-head-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(180deg, #FEEF90 0%, #FDE25A 100%);
  border: 1px solid var(--banana-500);
  box-shadow: 0 2px 0 var(--banana-600);
}

.submit-card-head-text {
  text-align: left;
  min-width: 0;
}

.submit-card-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.submit-card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Status strip: mode + cloud + progress */
.submit-status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 22px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.submit-status-strip .mode-pill,
.submit-status-strip .cloud-pill {
  cursor: default;
}

.submit-progress {
  flex: 1 1 200px;
  min-width: 170px;
}

.submit-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.submit-progress-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.submit-progress-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--banana-900);
  white-space: nowrap;
}

.submit-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #E7E0CE;
  overflow: hidden;
}

.submit-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FDE25A 0%, #F5C518 100%);
  transition: width 0.35s ease;
}

.submit-progress-fill.is-complete {
  background: linear-gradient(90deg, #7BC47F 0%, #2E8540 100%);
}

.submit-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 22px 0;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  color: var(--banana-900);
  background: var(--banana-100);
  border: 1.5px solid var(--banana-300);
  border-radius: var(--radius-sm);
}

.submit-hint[hidden] {
  display: none;
}

.submit-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
  padding: 16px 22px 20px;
  border-top: 1px dashed var(--border-light);
}

.submit-card #submit-quiz-btn {
  padding: 12px 28px;
  font-size: 15px;
}

/* ==========================================================================
   Image Lightbox (Zoom Viewer)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  flex-direction: column;
  background: rgba(20, 14, 6, 0.93);
  backdrop-filter: blur(3px);
}

.lightbox.active {
  display: flex;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(30, 20, 10, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.lightbox-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--banana-900);
  background: linear-gradient(180deg, #FDE25A 0%, #EDB70D 100%);
  border: 1px solid #C49405;
  border-radius: var(--radius-btn);
  box-shadow: 0 2px 0 #9E7400;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.lightbox-btn:hover {
  background: linear-gradient(180deg, #FEE976 0%, #F5C118 100%);
  box-shadow: 0 3px 0 #9E7400;
}

.lightbox-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0.5px 0 #9E7400;
}

.lightbox-btn-close {
  margin-left: auto;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5EEDD 100%);
  border-color: #D6C8A8;
  color: var(--text-primary);
  box-shadow: 0 2px 0 #BFB08E;
  font-size: 22px;
}

.lightbox-btn-close:hover {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF3E6 100%);
  box-shadow: 0 3px 0 #BFB08E;
}

.lightbox-zoom-level {
  min-width: 58px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #FFF6D6;
  font-variant-numeric: tabular-nums;
}

.lightbox-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox-stage.is-zoomed {
  cursor: grab;
}

.lightbox-stage.is-dragging {
  cursor: grabbing;
}

.lightbox-image-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.lightbox-image {
  display: block;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.lightbox-image.is-dragging {
  transition: none;
}

.lightbox-caption {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: #FFF6D6;
  background: rgba(30, 20, 10, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 38px;
}

/* Gambar di soal: invites zoom */
.question-body img[data-zoomable],
.choice-text img[data-zoomable],
.feedback-box img[data-zoomable] {
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.question-body img[data-zoomable]:hover,
.choice-text img[data-zoomable]:hover,
.feedback-box img[data-zoomable]:hover {
  border-color: var(--banana-400);
  box-shadow: 0 4px 12px rgba(158, 116, 0, 0.18);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 10, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.modal-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.score-display-big {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--banana-700);
  margin: 10px 0;
}

/* Dual Score Comparison Display in Modal */
.dual-score-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
  text-align: left;
}

.score-box-col {
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.first-attempt-box {
  background: #FAF8F2;
  border-color: #E2DAC8;
}

.final-attempt-box {
  background: #FFFDF4;
  border-color: var(--banana-400);
  box-shadow: 0 2px 8px rgba(245, 197, 24, 0.12);
}

.score-box-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.score-box-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.final-attempt-box .score-box-value {
  color: var(--banana-800);
}

.score-box-max {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
}

.score-box-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
}

.final-attempt-box .score-box-note {
  color: var(--banana-900);
}

.modal-feedback {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Spinner */
.ai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  border-top-color: var(--banana-900);
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ==========================================================================
   Question Navigation Drawer
   ========================================================================== */
.nav-toggle-btn {
  padding: 5px 12px;
  font-size: 13px;
  gap: 6px;
}

.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 10, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  display: flex;
  justify-content: flex-end;
}

.nav-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer {
  background: #FFFFFF;
  width: 100%;
  max-width: 380px;
  height: 100%;
  box-shadow: -4px 0 24px rgba(30, 20, 10, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-drawer-overlay.active .nav-drawer {
  transform: translateX(0);
}

.nav-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
}

.nav-drawer-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.nav-drawer-close:hover {
  color: var(--text-primary);
}

.nav-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.nav-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border-light);
  font-size: 12.5px;
  color: var(--text-secondary);
}

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

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

.legend-dot.unanswered {
  background: #E5E0D5;
  border: 1px solid #C8BEAC;
}

.legend-dot.correct {
  background: #2E8540;
}

.legend-dot.wrong {
  background: #D93838;
}

.nav-section-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.nav-section-actions {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}

.nav-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-actions .btn-tactile {
  width: 100%;
}

.nav-drawer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.nav-drawer-progress {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.nav-drawer-hint {
  margin: 0 0 12px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.nav-num-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1.5px 0 #E0D5BE;
  user-select: none;
}

.nav-num-btn:hover {
  background: var(--bg-subtle);
  border-color: #D6C8A8;
  transform: translateY(-1px);
}

.nav-num-btn.status-correct {
  background: #EAF7ED;
  border-color: #A4D9B2;
  color: #1A592B;
  box-shadow: 0 1.5px 0 #7FC791;
}

.nav-num-btn.status-wrong {
  background: #FDF1F1;
  border-color: #F5B2B2;
  color: #8C1C1C;
  box-shadow: 0 1.5px 0 #EAA0A0;
}

@keyframes jumpPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.7); border-color: var(--banana-500); }
  50% { box-shadow: 0 0 0 8px rgba(245, 197, 24, 0.35); border-color: var(--banana-500); }
  100% { box-shadow: 0 1px 3px rgba(40, 30, 15, 0.05); }
}

.question-card.highlight-jump {
  animation: jumpPulse 1.2s ease;
}

/* ==========================================================================
   Mobile Friendly & Responsive Rules (Single-Row Header & Adaptive UI)
   ========================================================================== */
@media (max-width: 680px) {
  body {
    padding-top: 58px; /* 52px fixed mobile header + 6px breathing room */
    padding-bottom: max(60px, env(safe-area-inset-bottom, 20px));
  }

  /* Prevent automatic iOS Safari zoom by enforcing >= 16px input fonts */
  input[type="text"],
  input[type="number"],
  input[type="search"],
  textarea,
  select,
  .form-input,
  .interactive-cell-input,
  .part-input {
    font-size: 16px !important;
  }

  /* --------------------------------------------------------------------------
     Single-Row Fixed Header with Icon-Only Mode & Dynamic Name Space
     -------------------------------------------------------------------------- */
  .top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 52px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    z-index: 100;
  }

  .top-nav-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100%;
    gap: 6px;
    flex-wrap: nowrap !important;
  }

  .brand-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    min-width: 0;
    flex-shrink: 0;
  }

  .brand-star {
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex-shrink: 0;
  }

  .brand-text-full {
    display: none;
  }

  .brand-text-short {
    display: inline;
    font-weight: 800;
  }

  /* When quiz is active: Hide brand text completely on mobile for maximum pill space */
  body.quiz-active .brand-text {
    display: none !important;
  }

  body.quiz-active .top-nav-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px;
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
  }

  .stats-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px;
    min-width: 0;
    flex: 1;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: flex-end;
  }

  .stat-pill {
    padding: 4px 6px;
    font-size: 11.5px;
    line-height: 1.2;
    height: 30px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(40, 30, 15, 0.06);
  }

  /* Participant Pill: dynamically expands to fit full name without arbitrary limits */
  .student-pill {
    flex: 0 1 auto;
    min-width: 0;
    max-width: fit-content;
    padding: 4px 7px;
    font-size: 11.5px;
    font-weight: 600;
  }

  .student-pill .pill-icon {
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
  }

  .student-pill .student-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Allows full name to show if there is room, truncating only when truly needed */
  }

  /* Mode Pill: ICON ONLY (🎯 or ☕) */
  .top-nav .mode-pill {
    width: 30px;
    min-width: 30px;
    padding: 0 !important;
    justify-content: center !important;
    font-size: 13px;
    flex-shrink: 0;
    cursor: default;
  }

  .top-nav .mode-pill .mode-text {
    display: none !important;
  }

  .stats-pills-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .score-pill,
  #live-score {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 7px;
    background: var(--banana-100);
    border-color: var(--banana-400);
    color: var(--banana-900);
    flex-shrink: 0;
  }

  .top-nav .cloud-pill {
    padding: 4px 6px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .top-nav .cloud-pill .cloud-text {
    display: none !important;
  }

  .count-pill,
  #answered-count {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 6px;
    color: var(--text-secondary);
    flex-shrink: 0;
  }

  /* Nav Drawer Toggle Button: ICON ONLY tactile button */
  .nav-btn-text {
    display: none !important;
  }

  .nav-toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    flex-shrink: 0;
  }

  .nav-toggle-btn svg {
    width: 15px;
    height: 15px;
  }

  /* --------------------------------------------------------------------------
     Container & Content Cards
     -------------------------------------------------------------------------- */
  .container {
    padding: 0 10px;
    margin: 10px auto;
    gap: 12px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .card {
    scroll-margin-top: 58px;
  }

  .header-content {
    padding: 16px 14px;
  }

  .quiz-title {
    font-size: 1.3rem;
    line-height: 1.3;
  }

  .quiz-desc {
    font-size: 13px;
    line-height: 1.5;
  }

  .participant-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
  }

  /* Class options as equal touch cards */
  .class-choice-group {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .class-choice-item {
    flex: 1;
    min-height: 44px;
    padding: 8px 10px;
    justify-content: center;
  }

  .mode-selection-wrapper {
    margin-top: 12px;
  }

  .mode-select-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .mode-main-name {
    font-size: 13.5px;
  }

  .mode-status-tag {
    font-size: 10.5px;
    padding: 2px 6px;
  }

  .mode-sub-desc {
    font-size: 12px;
    line-height: 1.45;
  }

  .gate-actions button {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    min-height: 46px;
  }

  /* --------------------------------------------------------------------------
     Filter Card
     -------------------------------------------------------------------------- */
  .filter-card {
    padding: 6px 8px;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: 6px 11px;
    font-size: 12px;
    min-height: 34px;
  }

  .tab-text-full {
    display: none;
  }

  .tab-text-short {
    display: inline;
  }

  /* --------------------------------------------------------------------------
     Question Cards & Interactive Options
     -------------------------------------------------------------------------- */
  .question-card {
    padding: 15px 13px;
    gap: 12px;
    border-radius: 10px;
  }

  .question-body {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .question-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
    border: 1px solid var(--border-light);
  }

  .question-body table {
    display: block;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
    margin: 10px 0;
  }

  .choice-item {
    padding: 11px 13px;
    gap: 11px;
    min-height: 48px;
    border-radius: 9px;
    align-items: flex-start;
  }

  .choice-radio {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 11px;
    margin-top: 1px;
    flex-shrink: 0;
  }

  .choice-text {
    font-size: 13.5px;
    line-height: 1.5;
    flex: 1;
    word-break: break-word;
  }

  .question-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 12px;
  }

  .question-actions .btn-tactile {
    width: 100%;
    min-height: 44px;
    padding: 11px 16px;
    font-size: 14.5px;
    justify-content: center;
  }

  /* --------------------------------------------------------------------------
     Uraian Forms & Tables
     -------------------------------------------------------------------------- */
  .part-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .part-input {
    width: 100%;
  }

  .interactive-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  .interactive-table-wrap::after {
    content: '👉 Geser tabel ke samping untuk melihat kolom lainnya';
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    background: #FAF7EE;
    padding: 5px 8px;
    border-top: 1px dashed var(--border-light);
    text-align: center;
  }

  .interactive-table {
    min-width: 500px;
    font-size: 12.5px;
  }

  .interactive-table th,
  .interactive-table td {
    padding: 7px 8px;
  }

  /* --------------------------------------------------------------------------
     Navigation Drawer on Mobile
     -------------------------------------------------------------------------- */
  .nav-drawer {
    max-width: min(340px, 86vw);
    width: 86vw;
  }

  .nav-drawer-header {
    padding: 14px 16px;
  }

  .nav-drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }

  .nav-drawer-body {
    padding: 12px 14px;
  }

  .nav-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .nav-num-btn {
    height: 38px;
    font-size: 12.5px;
  }

  /* --------------------------------------------------------------------------
     Modals on Mobile
     -------------------------------------------------------------------------- */
  .modal-overlay {
    padding: 14px;
  }

  .modal-content {
    padding: 20px 16px;
    max-width: 100% !important;
    width: 100%;
  }

  .dual-score-container {
    flex-direction: column;
    gap: 10px;
  }

  /* Submit Action Card */
  .submit-card {
    padding: 20px 14px;
  }

  .submit-card button {
    width: 100%;
    padding: 12px 18px;
    min-height: 46px;
  }
}

/* ==========================================================================
   Ultra-Compact Breakpoint (<= 360px - e.g. Galaxy Fold Cover / Small Screens)
   ========================================================================== */
@media (max-width: 360px) {
  .top-nav {
    padding: 0 6px;
  }

  .top-nav-inner {
    gap: 3px;
  }

  .stats-bar {
    gap: 3px;
  }

  /* On ultra-compact screens, student pill stays flexible to show as much name as possible */
  .student-pill {
    flex: 0 1 auto;
    min-width: 0;
    max-width: fit-content;
    padding: 2px 5px !important;
  }

  .student-pill .student-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-nav .mode-pill {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  .stat-pill {
    padding: 2px 4px;
    font-size: 10.5px;
    height: 28px;
  }

  .score-pill,
  #live-score {
    font-size: 10.5px;
    padding: 2px 5px;
  }

  .top-nav .cloud-pill {
    padding: 4px 6px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .top-nav .cloud-pill .cloud-text {
    display: none !important;
  }

  .count-pill,
  #answered-count {
    font-size: 10.5px;
    padding: 2px 5px;
  }

  .nav-toggle-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .nav-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .nav-num-btn {
    height: 36px;
    font-size: 11.5px;
  }
}

/* ==========================================================================
   Riwayat (history) on the landing page + in-quiz reset
   ========================================================================== */
.badge-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--banana-100);
  border: 1.5px solid var(--banana-300);
  color: var(--banana-900);
}

.past-sessions-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.past-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: var(--banana-100);
  border: 1.5px solid var(--banana-300);
  border-radius: var(--radius-sm);
}

.past-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
}

.past-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.past-sessions-list .past-session-item:last-child {
  margin-bottom: 0;
}

.past-session-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.past-meta-chip {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.past-meta-chip.chip-strict {
  background: #FFF4D0;
  border-color: var(--banana-300);
  color: var(--banana-900);
}

.past-meta-chip.chip-practice {
  background: var(--correct-bg);
  border-color: var(--correct-border);
  color: var(--correct-text);
}

.score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.score-badge small {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
}

.score-badge.score-good { background: var(--correct-bg); border-color: var(--correct-border); color: var(--correct-text); }
.score-badge.score-warn { background: var(--banana-100); border-color: var(--banana-300); color: var(--banana-900); }
.score-badge.score-bad  { background: var(--incorrect-bg); border-color: var(--incorrect-border); color: var(--incorrect-text); }

.past-detail-btn {
  padding: 7px 12px;
  font-size: 0.82rem;
}

@media (max-width: 520px) {
  .past-session-item {
    flex-direction: column;
    align-items: stretch;
  }
  .past-session-scores {
    justify-content: space-between;
  }
  .submit-actions > .btn-tactile {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   Past attempt detail modal (previously only styled on the admin page)
   ========================================================================== */
#past-detail-modal .modal-content {
  text-align: left;
}

.detail-summary-card {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.detail-sum-item .sum-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-sum-item .sum-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.q-detail-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.q-detail-card.is-correct { border-left: 5px solid var(--correct-border); }
.q-detail-card.is-warn { border-left: 5px solid var(--banana-400); }
.q-detail-card.is-incorrect { border-left: 5px solid var(--incorrect-border); }

.q-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.q-badge-status {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.q-badge-status.correct { background: var(--correct-bg); color: var(--correct-text); }
.q-badge-status.warn { background: var(--banana-100); color: var(--banana-900); }
.q-badge-status.incorrect { background: var(--incorrect-bg); color: var(--incorrect-text); }

.uraian-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-top: 6px;
  white-space: pre-wrap;
}

.ai-feedback-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: #FEF9C3;
  border: 1px solid #FDE047;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #713F12;
  font-weight: 600;
}

.past-sessions-card {
  padding: 22px 28px;
}

.past-stat {
  background: var(--bg-subtle);
  border-color: var(--border-light);
}

.past-sessions-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
}

.past-sessions-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.past-sessions-heading {
  flex: 1;
  min-width: 0;
}

.past-sessions-heading h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.past-sessions-heading p {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

@media (max-width: 680px) {
  .past-sessions-card {
    padding: 16px 14px;
  }
  .past-sessions-header {
    flex-wrap: wrap;
  }
  .past-sessions-header .badge-pill {
    margin-left: auto;
  }
}

/* Keep the top bar the same height on the landing page and in the quiz (no layout jump when starting) */
.top-nav-inner {
  min-height: 46px;
}

.nav-toggle-btn {
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 34px;
}

@media (max-width: 680px) {
  .top-nav-inner {
    min-height: 0;
  }
}

/* ==========================================================================
   "AI sedang menilai..." shimmer shown while an essay is being graded
   ========================================================================== */
.feedback-box.grading {
  display: block;
  background: #FFFDF1;
  border: 1px dashed var(--banana-400);
}

.ai-shimmer {
  display: inline-block;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--banana-700); /* fallback if background-clip: text is unsupported */
  background: linear-gradient(100deg, var(--banana-700) 0%, var(--banana-700) 35%, #FFD23F 50%, var(--banana-700) 65%, var(--banana-700) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aiShimmer 1.5s linear infinite;
}

@keyframes aiShimmer {
  from { background-position: 125% 0; }
  to { background-position: -125% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-shimmer {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ==========================================================================
   Simulasi ASAS: Multi-Mapel & Dynamic Badges Styling
   ========================================================================== */

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 7px;
  border: 1.5px solid var(--text-primary);
  background: var(--banana-200);
  overflow: hidden;
  box-shadow: 0 2px 0 var(--text-primary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.brand-badge:hover .brand-logo-wrap {
  transform: rotate(6deg) scale(1.06);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stat-pill.pack-pill {
  background: var(--banana-200);
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Header Hero Banner with Dynamic Subject Badge */
.header-hero-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.header-logo-container {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: 16px;
  border: 2.5px solid var(--text-primary);
  background: var(--banana-100);
  box-shadow: 0 4px 0 var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.header-subject-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-hero-text {
  flex: 1;
  min-width: 0;
}

.header-hero-text .quiz-title {
  margin-bottom: 4px;
}

.header-hero-text .quiz-desc {
  margin-bottom: 0;
  font-weight: 500;
}

/* Pack Selection Section on Homepage */
.pack-selection-wrapper {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1.5px dashed var(--border-light);
}

.pack-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pack-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--banana-200);
  border: 1.5px solid var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.pack-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.pack-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 4px 0 var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pack-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--text-primary);
  background: #FFFDF8;
}

.pack-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--text-primary);
}

.pack-card.active {
  background: var(--banana-100);
  border: 2.5px solid var(--text-primary);
  box-shadow: 0 5px 0 var(--text-primary);
}

.pack-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pack-card-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1.8px solid var(--text-primary);
  background: #FFFFFF;
  box-shadow: 0 2px 0 var(--text-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pack-card-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pack-check-indicator {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-primary);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: transparent;
  transition: all 0.15s ease;
}

.pack-card.active .pack-check-indicator {
  background: var(--banana-400);
  color: var(--text-primary);
  box-shadow: 0 1px 0 var(--text-primary);
}

.pack-card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 3px;
}

.pack-card-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.pack-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 8px;
  margin-bottom: 12px;
}

.pack-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}

.pack-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pack-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1.2px solid var(--border-light);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.pack-card.active .pack-badge-pill {
  background: var(--banana-200);
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.pack-status-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--correct-text);
  background: var(--correct-bg);
  border: 1px solid var(--correct-border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.pack-card-loading {
  padding: 24px;
  text-align: center;
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-card);
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .header-hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-logo-container {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }
  .pack-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Tactile Golden Star Hero & Badges
   ========================================================================== */

.header-hero-star {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: 18px;
  border: 2.5px solid var(--text-primary);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF5CC 100%);
  box-shadow: 0 4px 0 var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-hero-star:hover {
  transform: rotate(8deg) scale(1.05);
}

.header-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.header-meta {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--banana-200);
  border: 1.5px solid var(--text-primary);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 1.5px 0 var(--text-primary);
}

/* ==========================================================================
   Multi-Page Catalog & Mapel Browser Styling
   ========================================================================== */

.catalog-section {
  margin-top: 24px;
  margin-bottom: 24px;
}

.catalog-section-header {
  margin-bottom: 16px;
}

.catalog-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.catalog-section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-search-wrap {
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid var(--text-primary);
  border-radius: 12px;
  padding: 0 14px;
  box-shadow: 0 3px 0 var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
  border-color: var(--banana-500);
  box-shadow: 0 3px 0 var(--banana-500);
}

.search-box .search-icon {
  font-size: 16px;
  margin-right: 10px;
  opacity: 0.7;
}

.mapel-search-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  padding: 12px 0;
  width: 100%;
}

.mapel-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.catalog-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  background: #FFFFFF;
  border: 1.5px solid var(--text-primary);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--text-primary);
  transition: all 0.12s ease;
}

.filter-chip:hover {
  background: var(--banana-100);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--banana-400);
  color: var(--text-primary);
  border-color: var(--text-primary);
  box-shadow: 0 2px 0 var(--text-primary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.catalog-card {
  background: var(--bg-card);
  border: 2px solid var(--text-primary);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--text-primary);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 var(--text-primary);
}

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

.catalog-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--banana-200);
  border: 2px solid var(--text-primary);
  box-shadow: 0 2.5px 0 var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.catalog-header-lead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-code {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.badge-grade {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--banana-100);
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
  padding: 2.5px 8px;
  border-radius: 6px;
}

.catalog-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.catalog-pack-name {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--banana-600, #9A6200);
  margin-bottom: 8px;
}

.catalog-pack-desc {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card-footer {
  border-top: 1.5px dashed var(--border-light);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-pill b {
  color: var(--text-primary);
  font-weight: 800;
}

.btn-enter-quiz {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 800;
  padding: 10px 16px;
  text-align: center;
  box-sizing: border-box;
}

.catalog-empty-card {
  text-align: center;
  padding: 44px 20px;
  background: var(--bg-card);
  border: 2px dashed var(--border-light);
  border-radius: 16px;
  margin-top: 10px;
  grid-column: 1 / -1;
}

.catalog-empty-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 10px 0 6px;
}

.catalog-empty-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Back to catalog, under the hero on the quiz page */
.hero-back-btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nav-admin-btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 640px) {
  .header-hero-star {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Quiz Page Typography (readability pass)
   Teks & bobot font diperbesar khusus halaman quiz; dashboard admin tetap
   memakai tipografi ringkasnya.
   ========================================================================== */
body.quiz-page {
  font-size: 16px;
}

body.quiz-page .stat-pill {
  font-size: 14px;
  font-weight: 700;
}

body.quiz-page .quiz-title {
  font-size: 1.95rem;
}

body.quiz-page .quiz-desc {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
}

body.quiz-page .form-label {
  font-size: 15px;
  font-weight: 700;
}

body.quiz-page .form-input {
  font-size: 16px;
  font-weight: 500;
}

body.quiz-page .class-label-text {
  font-size: 16px;
}

body.quiz-page .mode-main-name {
  font-size: 16px;
}

body.quiz-page .mode-sub-desc {
  font-size: 14px;
  line-height: 1.6;
}

body.quiz-page .mode-status-tag {
  font-size: 12.5px;
}

body.quiz-page .tab-btn {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
}

body.quiz-page .question-body {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
}

body.quiz-page .q-num {
  font-size: 16px;
}

body.quiz-page .q-points {
  font-size: 13px;
  font-weight: 700;
}

body.quiz-page .question-body table {
  font-size: 15px;
}

body.quiz-page .choice-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

body.quiz-page .choice-item {
  padding: 12px 16px;
}

body.quiz-page .choice-radio {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

body.quiz-page .btn-tactile {
  font-size: 15.5px;
  font-weight: 800;
}

body.quiz-page .feedback-title {
  font-size: 15.5px;
  font-weight: 800;
}

body.quiz-page .feedback-content {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}

body.quiz-page .essay-textarea {
  font-size: 16px;
  font-weight: 500;
}

body.quiz-page .part-prompt {
  font-size: 15px;
  font-weight: 700;
}

body.quiz-page .interactive-table {
  font-size: 15px;
}

body.quiz-page .interactive-cell-input {
  font-size: 15px;
  font-weight: 500;
}

body.quiz-page .row-status-cell {
  font-size: 13px;
}

body.quiz-page .row-badge {
  font-size: 13px;
}

body.quiz-page .submit-card-title {
  font-size: 1.4rem;
}

body.quiz-page .submit-card-desc {
  font-size: 15.5px;
  font-weight: 500;
}

body.quiz-page .submit-progress-label {
  font-size: 11.5px;
}

body.quiz-page .submit-progress-count {
  font-size: 13.5px;
}

body.quiz-page .submit-hint {
  font-size: 14px;
}

body.quiz-page .nav-section-title {
  font-size: 15px;
}

body.quiz-page .nav-num-btn {
  font-size: 15.5px;
  height: 44px;
}

body.quiz-page .nav-legend {
  font-size: 13.5px;
}

body.quiz-page .nav-drawer-title {
  font-size: 17px;
}

body.quiz-page .lightbox-caption {
  font-size: 14px;
}

body.quiz-page .modal-title {
  font-size: 1.7rem;
}

body.quiz-page #dialog-message {
  font-size: 16px;
  font-weight: 500;
}

body.quiz-page .admin-login-link,
body.quiz-page .landing-credit-text {
  font-size: 0.95rem;
  font-weight: 700;
}

body.quiz-page .question-card {
  padding: 26px 30px;
  gap: 18px;
}

body.quiz-page .choice-list {
  gap: 10px;
}

body.quiz-page .feedback-box {
  padding: 16px 20px;
}

body.quiz-page .ai-feedback-box {
  font-size: 0.92rem;
  padding: 10px 12px;
  line-height: 1.6;
}
