* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  background-color: #f4f6f8;
  color: #333;
  display: flex;
  flex-direction: column;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background 0.3s ease;
}

.hidden {
  display: none !important;
}

/* Brand Badge for Student Portal */
.brand-badge-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.08);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  margin-bottom: 14px;
}
.brand-badge-portal .brand-icon {
  font-size: 18px;
  line-height: 1;
}
.brand-badge-portal .brand-title {
  font-size: 14px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: 0.3px;
}
.brand-badge-portal .brand-logo-img {
  height: 24px;
  max-width: 80px;
  object-fit: contain;
  border-radius: 3px;
}

/* Screen 1: หน้าลงทะเบียน */
.screen-card {
  max-width: 480px;
  width: 92%;
  margin: 40px auto 30px;
  padding: 30px 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: 0 15px 35px -5px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.6);
  text-align: center;
}
.screen-card h2 {
  font-size: 22px;
  color: #0f172a;
  margin-bottom: 18px;
}
.screen-card .form-group {
  text-align: left;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-group input:read-only {
  background-color: #f1f5f9;
  color: #334155;
  cursor: not-allowed;
  border-color: #cbd5e1;
}

.agreement-box {
  background: #fff8e1;
  padding: 12px;
  font-size: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  border: 1px solid #ffe082;
}

.agreement-box ol {
  margin-left: 20px;
  margin-top: 6px;
  margin-bottom: 8px;
}

#btnJoin {
  width: 100%;
  padding: 12px;
  background-color: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

#btnJoin:disabled {
  background-color: #b0bec5;
  cursor: not-allowed;
}

.waiting-box {
  margin-top: 18px;
  padding: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  text-align: center;
  color: #166534;
  font-size: 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #bbf7d0;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

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

/* Screen 2: หน้าทำข้อสอบ Split View */
.exam-header {
  height: 52px;
  background: #1e293b;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
}

.exam-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge-exam {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.brand-badge-exam .brand-icon {
  font-size: 15px;
  line-height: 1;
}
.brand-badge-exam .brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}
.brand-badge-exam .brand-logo-img {
  height: 20px;
  max-width: 65px;
  object-fit: contain;
}

/* Student Header Tools (Zoom, Highlighter, Scratchpad) */
.exam-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-zoom-widget {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2px 6px;
  gap: 4px;
}

.student-zoom-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.student-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.student-zoom-badge {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  min-width: 42px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.student-zoom-badge:hover {
  background: rgba(56, 189, 248, 0.15);
}

.exam-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exam-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.exam-tool-btn.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.badge {
  background: #2e7d32;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 10px;
  transition: background-color 0.3s;
}

.timer-block {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  background: #0f172a;
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.timer-block.warning {
  color: #f87171;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.danger-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.danger-btn:hover {
  background: #b91c1c;
}

.split-view {
  display: flex;
  height: calc(100vh - 50px);
}

.pane {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.left-pane {
  border-right: 2px solid #e2e8f0;
  background: #ffffff;
}

.right-pane {
  background: #fafafa;
}

/* Question Palette (แผงตัวเลขข้อสอบและสถานะ ทำแล้ว=เขียว / ยังไม่ทำ=แดง) */
.q-palette-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.q-palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.q-palette-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.q-palette-legend {
  display: flex;
  gap: 8px;
}

.legend-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-green {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.legend-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.q-palette-slider {
  display: flex;
  align-items: center;
  gap: 6px;
}

.palette-arrow-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 28px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.palette-arrow-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.question-palette-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 4px 2px;
  flex: 1;
}

.question-palette-track::-webkit-scrollbar {
  display: none;
}

.palette-num-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
}

/* ข้อที่ยังไม่ทำ: สีแดง */
.palette-num-btn.unanswered {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #dc2626;
}
.palette-num-btn.unanswered:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* ข้อที่ทำแล้ว: สีเขียว */
.palette-num-btn.answered {
  background: #f0fdf4;
  border: 2px solid #22c55e;
  color: #16a34a;
}
.palette-num-btn.answered:hover {
  background: #dcfce7;
  border-color: #16a34a;
}

/* ข้อปัจจุบันที่กำลังดูอยู่: วงแหวน Active เด่นชัด */
.palette-num-btn.active {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45);
  transform: scale(1.08);
  border-color: #2563eb !important;
}

.palette-num-btn.active.unanswered {
  background: #fee2e2;
  color: #991b1b;
}

.palette-num-btn.active.answered {
  background: #dcfce7;
  color: #166534;
}

.q-nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.nav-step-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-step-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.nav-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.current-q-pill {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 999px;
}

.question-body h3 {
  font-size: 18px;
  line-height: 1.5;
  color: #0f172a;
  margin-bottom: 12px;
}

.options-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.options-list label:hover {
  background: #f8fafc;
  border-color: #93c5fd;
}

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

.code-toolbar button {
  padding: 5px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.code-toolbar button:hover {
  background: #e2e8f0;
}

.CodeMirror {
  height: calc(100vh - 165px);
  min-height: 380px;
  max-height: 700px;
  font-size: 14.5px;
  border-radius: 6px;
  border: 1px solid #334155;
}

/* Open-Ended Question Style */
.open-ended-input {
  width: 100%;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  background: white;
}
.open-ended-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Matching Question Style */
.matching-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.matching-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.matching-left-term {
  flex: 1;
  font-weight: 600;
  color: #0f172a;
}

.matching-arrow {
  color: #94a3b8;
  font-weight: bold;
}

.matching-select {
  flex: 1.4;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 14px;
  cursor: pointer;
}
.matching-select:focus {
  outline: none;
  border-color: #2563eb;
  background: white;
}

/* Fill in the Blank Style */
.fill-blank-prompt {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 20px 24px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  color: #0f172a;
  line-height: 2.3;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.inline-blank-wrapper {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
}

.inline-blank-input {
  display: inline-block;
  min-width: 140px;
  max-width: 340px;
  padding: 5px 12px;
  font-size: 17px;
  font-weight: 700;
  color: #1e3a8a;
  background-color: #eff6ff;
  border: 2px solid #2563eb;
  border-radius: 6px;
  text-align: center;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.inline-blank-input:focus {
  background-color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.fill-blank-warning {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 14px;
  line-height: 1.5;
}

.fill-blank-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 15px;
  background: white;
}
.fill-blank-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Screen 3: Submitted Summary Box */
.summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
  text-align: left;
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
}

/* Broadcast Banner */
#broadcast-banner {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  z-index: 9999;
}

.broadcast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.broadcast-content button {
  padding: 4px 10px;
  background: white;
  color: #dc2626;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* Screen Locked Overlay */
.locked-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.96);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.locked-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Floating Student Chat */
.chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  font-weight: bold;
  z-index: 500;
}

.student-chat-window {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 330px;
  height: 420px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 500;
  border: 1px solid #cbd5e1;
}

.chat-header {
  background: #1e293b;
  color: white;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 7px 7px 0 0;
}

.chat-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}

.chat-msg {
  padding: 8px 12px;
  border-radius: 6px;
  max-width: 82%;
  font-size: 13px;
  word-break: break-word;
}

.chat-msg.me {
  background: #2563eb;
  color: white;
  align-self: flex-end;
}

.chat-msg.teacher {
  background: #e2e8f0;
  color: #1e293b;
  align-self: flex-start;
}

.chat-input-area {
  display: flex;
  padding: 8px;
  border-top: 1px solid #e2e8f0;
}

.chat-input-area input {
  flex: 1;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.chat-input-area button {
  padding: 8px 14px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  margin-left: 6px;
  cursor: pointer;
}

/* Footer Credit & Network Info */
.app-footer {
  margin-top: auto;
  text-align: center;
  padding: 12px 20px;
  font-size: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
  z-index: 50;
  position: relative;
}
.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.5;
}
.app-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.app-footer a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}
.footer-divider {
  color: #cbd5e1;
  font-size: 11px;
}
.footer-license a {
  color: #059669;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.footer-network-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(241, 245, 249, 0.9);
  padding: 2px 10px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  color: #475569;
}
.network-badge b {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 600;
  color: #0f172a;
}
.network-badge.ip-public b {
  color: #2563eb;
}
.network-badge.ip-local b {
  color: #7c3aed;
}

/* Custom Modern Slim Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 rgba(0, 0, 0, 0.04);
}

/* =========================================================
   Responsive Breakpoints & 16:9 Screen Optimizations
   ========================================================= */

/* สำหรับจอขนาด 16:9 (1600x900 & 1920x1080) */
@media (min-width: 1400px) {
  .split-view {
    height: calc(100vh - 52px);
  }
  .pane {
    padding: 24px;
  }
  .question-body h3 {
    font-size: 19px;
  }
}

/* จอแท็บเล็ต / หน้าต่างย่อ < 992px */
@media (max-width: 991px) {
  .split-view {
    flex-direction: column;
    height: auto;
  }
  .pane {
    height: auto;
    overflow-y: visible;
    padding: 16px;
  }
  .left-pane {
    border-right: none;
    border-bottom: 2px solid #e2e8f0;
  }
  .CodeMirror {
    height: 420px;
    max-height: none;
  }
}

/* จอมือถือ < 640px */
@media (max-width: 639px) {
  .exam-header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .exam-header-left {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-badge-exam {
    order: -1;
  }
  .screen-card {
    padding: 22px 18px;
    margin: 20px auto;
  }
}

/* Question Body Image Display */
.question-image-box {
  margin: 14px 0 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  display: inline-block;
  max-width: 100%;
}
.question-image-preview {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.question-image-preview:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.question-image-zoom-tip {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 6px;
  text-align: center;
}

/* Image Zoom Modal (Lightbox) */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.image-modal-box {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}
.image-modal-box img {
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
}
.image-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.image-modal-close:hover {
  transform: scale(1.15);
}

/* Student True / False Question Options */
.tf-student-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
.tf-student-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}
.tf-student-true {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.tf-student-true:hover {
  background: #dcfce7;
  border-color: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.15);
}
.tf-student-true.selected {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
  transform: scale(1.02);
}
.tf-student-false {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.tf-student-false:hover {
  background: #fee2e2;
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.15);
}
.tf-student-false.selected {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35);
  transform: scale(1.02);
}
.tf-student-icon {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.tf-student-text {
  font-size: 17px;
  font-weight: 700;
}

/* Student Ordering Question List (Drag & Drop + Buttons) */
.ordering-student-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.ordering-student-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.ordering-student-item:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}
.ordering-student-item.dragging {
  opacity: 0.45;
  background: #eff6ff;
  border-style: dashed;
  border-color: #2563eb;
}
.ordering-student-item.drag-over {
  border-color: #2563eb;
  background: #dbeafe;
  transform: scale(1.02);
}
.ordering-item-handle {
  font-size: 16px;
  color: #94a3b8;
  cursor: grab;
  padding: 0 4px;
}
.ordering-item-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ordering-item-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
}
.ordering-item-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ordering-btn-move {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ordering-btn-move:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.ordering-btn-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ordering-confirm-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ordering-confirm-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.ordering-confirm-btn.confirmed {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}


/* Highlighter Banner & Mark */
.highlighter-active-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fef9c3;
  border: 1px solid #facc15;
  color: #854d0e;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
}

.clear-hl-btn {
  background: #ffffff;
  border: 1px solid #eab308;
  color: #a16207;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.clear-hl-btn:hover {
  background: #fef08a;
}

mark.exam-mark-yellow {
  background-color: #fde047;
  color: #0f172a;
  padding: 1px 3px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Scratchpad Quick FAB */
.scratchpad-fab {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.scratchpad-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

/* Scratchpad Modal (Floating & Draggable) */
.scratchpad-modal {
  position: fixed;
  top: 70px;
  right: 30px;
  width: 660px;
  max-width: calc(100vw - 40px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.scratchpad-header {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}

.scratchpad-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.scratchpad-badge-hint {
  font-size: 10px;
  background: #334155;
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}

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

.scratchpad-head-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.scratchpad-head-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.scratchpad-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}

.scratch-tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scratch-tab-btn.active {
  background: #ffffff;
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.scratch-tab-pane {
  padding: 12px;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 10px;
}

.canvas-colors {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #2563eb;
  transform: scale(1.15);
}

.canvas-tool-group {
  display: flex;
  gap: 4px;
}

.canvas-tool-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.canvas-tool-btn.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.canvas-size-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.canvas-size-group select {
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: white;
}

.canvas-clear-btn {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.canvas-clear-btn:hover {
  background: #fee2e2;
}

.canvas-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

#scratchpadCanvas {
  display: block;
  width: 100%;
  height: 320px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

#scratchpadNotesInput {
  width: 100%;
  height: 350px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  font-family: inherit;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

#scratchpadNotesInput:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================
   28. ANSWER BLURRED & UNLOCK CONTROLS
   ========================================== */
.answer-locked-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.15);
  animation: slideDownNotice 0.25s ease-out;
}

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

.answer-locked-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.answer-locked-info .lock-icon {
  font-size: 26px;
  line-height: 1;
}

.answer-locked-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
}

.answer-locked-subtext {
  font-size: 12px;
  color: #b45309;
  margin-top: 2px;
}

.btn-unlock-answer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.btn-unlock-answer:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-unlock-answer:active {
  transform: translateY(0);
}

.answer-boxes-wrapper {
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.answer-boxes-wrapper.is-blurred {
  filter: blur(5px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  cursor: not-allowed;
}

/* ==========================================
   AUXILIARY WEB LINKS (Admin & Student)
   ========================================== */

/* Admin Settings Box */
.auxiliary-links-settings-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}

.aux-links-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.aux-links-empty {
  padding: 14px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12.5px;
}

.aux-link-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s;
}

.aux-link-card:hover {
  border-color: #93c5fd;
}

.aux-link-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.aux-link-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

.aux-btn-test {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.aux-btn-test:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.aux-btn-delete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.aux-btn-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.aux-link-card-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Student Header Auxiliary Links Bar */
.student-aux-links-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.aux-web-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
  transition: all 0.2s ease;
  user-select: none;
}

.aux-web-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.16);
}

.aux-web-btn:active {
  transform: translateY(0);
}

.aux-web-btn .aux-icon {
  font-size: 14px;
}

.aux-web-btn .aux-title {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aux-web-btn .aux-ext {
  font-size: 12px;
  opacity: 0.7;
}

/* ==========================================
   CONNECTION STATUS & OFFLINE RESILIENCE
   ========================================== */

.connection-status-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  user-select: none;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.connection-dot.online {
  background: #16a34a;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.6);
}

.connection-dot.reconnecting {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
  animation: pulse-dot 1.2s infinite;
}

.connection-dot.offline {
  background: #dc2626;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.8);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.btn-reconnect-manual {
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-reconnect-manual:hover {
  background: #b91c1c;
}

/* Offline Floating Banner */
.offline-notice-banner {
  background: #fffbeb;
  border-bottom: 2px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
  padding: 10px 18px;
  animation: slide-banner-down 0.25s ease-out;
  position: relative;
  z-index: 99;
}

@keyframes slide-banner-down {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.offline-banner-content {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.offline-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.offline-banner-text {
  flex: 1;
  font-size: 13px;
  color: #92400e;
  line-height: 1.4;
}

.btn-banner-reconnect {
  background: #d97706;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
  transition: all 0.2s;
}

.btn-banner-reconnect:hover {
  background: #b45309;
  transform: translateY(-1px);
}

/* ========================================================
   Room Mode Selector (Exam vs Homework)
   ======================================================== */
.mode-select-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-select-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.mode-select-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.mode-select-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #2563eb;
  cursor: pointer;
}

.mode-card-content {
  display: flex;
  flex-direction: column;
}

.mode-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.mode-card-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
}

.room-mode-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
}

.room-mode-tag.homework {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.room-mode-tag.exam {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.btn-mode-quick-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mode-quick-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.btn-mode-quick-toggle.homework {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.btn-mode-quick-toggle.exam {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.btn-card-del-student {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.btn-card-del-student:hover {
  opacity: 1;
  background: #fee2e2;
}

/* ==========================================
   Choice Code Blocks & Option Images (Student)
   ========================================== */
.options-list label {
  align-items: flex-start;
}
.mcq-option-body {
  flex: 1;
  min-width: 0;
}
.option-text-span {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.5;
  display: inline-block;
}
.option-code-block {
  margin: 4px 0 2px 0;
  padding: 8px 12px;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 6px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #1e293b;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.option-choice-img {
  max-width: 280px;
  max-height: 180px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin-top: 6px;
  display: block;
  object-fit: contain;
  cursor: zoom-in;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.option-choice-img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Rich Question Prompt Typography (WordPress style) */
.question-rich-title {
  font-size: 16.5px;
  line-height: 1.65;
  color: #0f172a;
  margin-bottom: 12px;
}
.question-rich-title p {
  margin: 0 0 8px;
}
.question-rich-title pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13.5px;
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid #1e293b;
}
.question-rich-title code {
  background: #f1f5f9;
  color: #0284c7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13.5px;
  border: 1px solid #e2e8f0;
}
.question-rich-title ul, .question-rich-title ol {
  margin: 6px 0 8px 24px;
  padding: 0;
}
.question-rich-title blockquote {
  border-left: 4px solid #3b82f6;
  margin: 8px 0;
  padding: 6px 12px;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 0 4px 4px 0;
}
.question-rich-title img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
}

/* ==========================================
   MINI ARCADE & GAMES (Snake, Tetris, Minesweeper)
   ========================================== */

.mini-arcade-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
  text-align: center;
}

.mini-arcade-box .arcade-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.arcade-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.arcade-game-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.arcade-game-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

/* Game Modal Overlay */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.game-modal-overlay.hidden {
  display: none !important;
}

.game-modal-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  color: #f8fafc;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-modal-header {
  padding: 12px 18px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.game-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.game-header-score {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-score-badge {
  background: #334155;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #475569;
}

.game-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.game-modal-close:hover {
  color: #ef4444;
}

.game-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.game-modal-footer {
  padding: 8px 14px;
  background: #1e293b;
  border-top: 1px solid #334155;
  text-align: center;
}

.game-footer-hint {
  font-size: 11.5px;
  color: #94a3b8;
}

.game-subview {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.game-subview.hidden {
  display: none !important;
}

.game-canvas-wrap {
  border: 2px solid #334155;
  border-radius: 8px;
  background: #020617;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#snakeCanvas, #tetrisCanvas {
  display: block;
}

/* Touch D-Pad Controls */
.game-touch-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  user-select: none;
}

.dpad-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dpad-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f8fafc;
  width: 46px;
  height: 42px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  touch-action: manipulation;
}

.dpad-btn:active {
  background: #3b82f6;
  transform: scale(0.93);
}

.dpad-btn.restart {
  background: #334155;
  color: #38bdf8;
  font-size: 18px;
}

.tetris-controls {
  width: 100%;
  max-width: 280px;
}

.tetris-controls .dpad-btn.rotate {
  width: 100%;
  height: 38px;
  font-size: 13px;
  background: #2563eb;
  border-color: #3b82f6;
}

.tetris-controls .dpad-btn.drop {
  width: 100%;
  height: 38px;
  font-size: 13px;
  background: #334155;
}

.tetris-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
}

.tetris-side-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tetris-stat-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 80px;
}

.tetris-stat-lbl {
  font-size: 10.5px;
  color: #94a3b8;
  display: block;
}

.tetris-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #38bdf8;
  display: block;
  margin-top: 2px;
}

.game-btn-action {
  background: #334155;
  color: #fff;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.game-btn-action:hover {
  background: #475569;
}

.game-btn-flag {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.game-btn-flag.active {
  background: #ef4444;
  border-color: #f87171;
  color: #fff;
}

/* Minesweeper */
.mines-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
  margin-bottom: 12px;
  background: #1e293b;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.mines-badge {
  font-size: 12px;
  color: #cbd5e1;
}

.mines-badge b {
  color: #ef4444;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(9, 32px);
  grid-template-rows: repeat(9, 32px);
  gap: 3px;
  background: #1e293b;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #334155;
  user-select: none;
}

.mine-cell {
  width: 32px;
  height: 32px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #f8fafc;
  transition: background 0.1s ease;
}

.mine-cell:hover:not(.revealed) {
  background: #475569;
}

.mine-cell.revealed {
  background: #0f172a;
  border-color: #1e293b;
  cursor: default;
}

.mine-cell.mine-hit {
  background: #dc2626 !important;
  color: #fff;
}

.mine-cell[data-count="1"] { color: #38bdf8; }
.mine-cell[data-count="2"] { color: #4ade80; }
.mine-cell[data-count="3"] { color: #f87171; }
.mine-cell[data-count="4"] { color: #c084fc; }
.mine-cell[data-count="5"] { color: #fbbf24; }
.mine-cell[data-count="6"] { color: #2dd4bf; }

/* Candy Match (Match-3) */
.candy-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 350px;
  margin-bottom: 12px;
  background: #1e293b;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  gap: 8px;
}

.candy-badge {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 600;
}

.candy-badge b {
  color: #f59e0b;
  font-size: 15px;
}

.candy-combo-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.candy-combo-badge.active {
  animation: comboPulse 0.4s ease alternate infinite;
}

@keyframes comboPulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.candy-grid {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  grid-template-rows: repeat(7, 44px);
  gap: 4px;
  background: #1e293b;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  user-select: none;
  touch-action: manipulation;
}

.candy-cell {
  width: 44px;
  height: 44px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  box-sizing: border-box;
  position: relative;
}

.candy-cell:hover {
  background: #1e293b;
  border-color: #475569;
}

.candy-cell.selected {
  background: #3b82f6 !important;
  border-color: #60a5fa !important;
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
  z-index: 2;
  animation: candySelectPulse 0.8s ease infinite alternate;
}

@keyframes candySelectPulse {
  from { box-shadow: 0 0 6px rgba(59, 130, 246, 0.6); }
  to { box-shadow: 0 0 16px rgba(96, 165, 250, 1); }
}

.candy-cell.matched {
  animation: candyPop 0.25s ease forwards;
}

@keyframes candyPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3) rotate(15deg); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

.candy-cell.invalid-shake {
  animation: candyShake 0.3s ease;
}

@keyframes candyShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.candy-hint-text {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 10px;
  text-align: center;
}

/* ============================================================
   ADMIN SIDEBAR ACCORDION DROPDOWN MENUS (v2.8)
   ============================================================ */
.nav-dropdown-group {
  margin-bottom: 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  overflow: visible;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-dropdown-group.open {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

.nav-dropdown-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #ffffff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #000000;
  text-align: left;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-header:hover {
  background: #f1f5f9;
  color: #000000;
}

.nav-dropdown-header .nav-title {
  color: #000000;
  font-weight: 700;
}

.nav-dropdown-group.open .nav-dropdown-header {
  border-bottom: 1px solid #e2e8f0;
}

.nav-dropdown-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000000;
}

.nav-dropdown-header-left .nav-icon {
  font-size: 15px;
  color: #000000;
}

.nav-dropdown-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-count-badge {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #000000;
  padding: 2px 7px;
  border-radius: 12px;
  min-width: 18px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.nav-dropdown-group.open .nav-count-badge {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.nav-chevron {
  font-size: 12px;
  color: #64748b;
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown-group.open .nav-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

.nav-dropdown-items {
  display: none;
  padding: 6px 6px 8px 6px;
  flex-direction: column;
  gap: 3px;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.nav-dropdown-group.open .nav-dropdown-items {
  display: flex !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* บังคับตัวหนังสือใน Dropdown เป็นสีดำสนิท อ่านชัดเจน 100% บนพื้นหลังขาว */
.nav-dropdown-items .nav-item-btn {
  color: #000000 !important;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  transition: all 0.15s ease;
}

.nav-dropdown-items .nav-item-btn:hover {
  background: #f1f5f9;
  color: #000000 !important;
}

.nav-dropdown-items .nav-item-btn .nav-text {
  color: #000000 !important;
  font-weight: 600;
}

.nav-dropdown-items .nav-item-btn .nav-icon {
  font-size: 15px;
}

.nav-dropdown-items .nav-item-btn.text-danger {
  color: #dc2626 !important;
  font-weight: 600;
}

.nav-dropdown-items .nav-item-btn.text-danger .nav-text {
  color: #dc2626 !important;
  font-weight: 600;
}

.nav-dropdown-items .nav-item-btn.text-danger:hover {
  background: #fee2e2;
  color: #991b1b !important;
}

/* ============================================================
   SELECTIVE IMPORT CHECKLIST COMPONENT (v2.8)
   ============================================================ */
.import-checklist-wrapper {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.import-checklist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.import-checklist-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.import-selected-count {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
}

.import-checklist-scroll {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.import-check-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.import-check-item:last-child {
  border-bottom: none;
}

.import-check-item:hover {
  background: #f8fafc;
}

.import-check-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.import-check-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
  margin: 0;
}

.import-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.import-item-code {
  font-weight: 700;
  color: #0f172a;
}

.import-item-name {
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.import-item-sub {
  font-size: 11.5px;
  color: #64748b;
}

.import-type-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

.import-points-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

#roomCode[readonly] {
    background: #eee;
    cursor: not-allowed;
}

/* ==========================================================================
   Phase 2: ExamKru Desktop Polish, Mobile Ergonomics & Anti-Cheat Guardrails
   ========================================================================== */

/* บล็อก Long-press / ลากคลุมคัดลอกข้อความบนมือถือเมื่อเปิด Anti-Copy */
body.exam-anti-copy #exam-section {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.exam-anti-copy #exam-section input,
body.exam-anti-copy #exam-section textarea,
body.exam-anti-copy #exam-section .CodeMirror,
body.exam-anti-copy #exam-section .CodeMirror * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* ลายน้ำระบุตัวตนทับพื้นที่ข้อสอบ (ไม่ขวางการคลิก) */
.exam-watermark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background-repeat: repeat;
  opacity: 0.45;
}

/* ม่านจอดำป้องกันการแคปจอ / สลับหน้าต่าง (Best-Effort Web Blackout Shield) */
.blackout-shield-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000000;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.blackout-shield-overlay.hidden {
  display: none !important;
}

.blackout-shield-box {
  max-width: 420px;
}

.blackout-shield-icon {
  font-size: 46px;
  margin-bottom: 12px;
}

.blackout-shield-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.blackout-shield-sub {
  font-size: 13.5px;
  color: #94a3b8;
}

/* อักขระล่องหน Zero-Width Honeypot (มองไม่เห็นด้วยตาเปล่า แต่ติดไปเมื่อก๊อปปี้) */
.honeypot-zw-trap {
  font-size: 0;
  line-height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* โหมด Anti-1-Shot: แยกพื้นที่โจทย์กับตัวเลือกกันถ่ายรูป 1 แชะติดทั้งคู่ */
.anti-oneshot-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 55;
}

.anti-oneshot-bar.hidden {
  display: none !important;
}

.oneshot-tab-btn {
  flex: 1;
  max-width: 280px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.oneshot-tab-btn.active {
  background: var(--ek-primary, #2563eb);
  border-color: var(--ek-primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

#exam-section.anti-oneshot-question #answerBoxesWrapper {
  filter: blur(15px);
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}

#exam-section.anti-oneshot-answer #question-content {
  filter: blur(15px);
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}

/* แถบเตือนช่วงผ่อนผันบนมือถือ */
.blur-grace-banner {
  position: fixed;
  top: calc(12px + var(--ek-safe-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: #b91c1c;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(185, 28, 28, 0.35);
  max-width: calc(100vw - 24px);
  text-align: center;
}

/* แถบนำทางล่างสำหรับมือถือ (ซ่อนบนคอมพิวเตอร์) */
.mobile-exam-bottom-bar {
  display: none;
}

/* ขัดเกลาการ์ดและตัวเลือกให้คมชัดขึ้นบนทั้งคอมพิวเตอร์และมือถือ */
.screen-card {
  border: 1px solid var(--ek-border, #e2e8f0);
  box-shadow: var(--ek-shadow-lg, 0 20px 35px -8px rgba(15, 23, 42, 0.14));
}

.option-item {
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.question-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

@media (max-width: 768px) {
  /* หน้าลงชื่อเข้าสอบบนมือถือ */
  #join-section.screen-card,
  #waiting-section.screen-card,
  #submitted-section.screen-card {
    margin: 12px auto;
    width: calc(100% - 20px);
    padding: 22px 18px calc(22px + var(--ek-safe-bottom, 0px));
    border-radius: 18px;
  }

  #join-section input,
  #join-section select,
  .open-ended-input,
  .fill-blank-input,
  .matching-select {
    font-size: 16px !important;
  }

  /* Header ห้องสอบแบบกระชับบนมือถือ */
  .exam-header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: calc(10px + var(--ek-safe-top, 0px)) 12px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .exam-header .header-left {
    width: 100%;
    justify-content: space-between;
  }

  .exam-header .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }

  /* แถบเลขข้อแบบเลื่อนแนวนอน ไม่กินพื้นที่ครึ่งจอ */
  .question-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 12px !important;
    gap: 6px !important;
  }

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

  .question-tabs .q-tab-btn,
  .question-tabs button {
    flex: 0 0 auto;
    min-width: 38px;
    min-height: 38px;
  }

  /* พื้นที่ข้อสอบเรียง 1 คอลัมน์ เว้นที่ให้แถบด้านล่าง */
  .exam-main {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100dvh - 150px);
    padding-bottom: calc(82px + var(--ek-safe-bottom, 0px)) !important;
  }

  .exam-main .pane {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding: 16px 14px !important;
  }

  .option-item,
  .tf-student-card {
    min-height: 52px;
    padding: 14px 16px;
  }

  .tf-student-options {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* แสดงแถบนำทางด้านล่างเฉพาะบนมือถือ */
  .mobile-exam-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--ek-border, #e2e8f0);
    padding: 10px 12px calc(10px + var(--ek-safe-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
  }

  .mobile-nav-btn {
    flex: 1;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--ek-border-strong, #cbd5e1);
    background: #ffffff;
    color: var(--ek-text, #0f172a);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
  }

  .mobile-nav-btn:active {
    transform: scale(0.98);
  }

  .mobile-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .mobile-nav-btn-primary {
    background: var(--ek-primary, #2563eb);
    border-color: var(--ek-primary, #2563eb);
    color: #ffffff;
  }

  .mobile-nav-pill {
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
  }
}