:root {
  --nem-primary: #059669;
  --nem-primary-light: #10b981;
  --nem-primary-soft: #ecfdf5;
  --nem-bg: #f1f5f9;
  --nem-card: #ffffff;
  --nem-text: #1e293b;
  --nem-muted: #64748b;
  --nem-border: #e2e8f0;
  --nem-sidebar-w: 270px;
}

body, html {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif !important;
  background-color: var(--nem-bg);
  color: var(--nem-text);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea, .form-control, .form-select, .btn, .badge,
.table, .modal, .swal2-popup, .dataTables_wrapper {
  font-family: 'Sarabun', sans-serif !important;
}

.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}
.fa-brands, .fab {
  font-family: "Font Awesome 6 Brands" !important;
}

.font-monospace, .pin-badge-mono {
  font-family: 'JetBrains Mono', monospace !important;
}

/* Global Loader */
.nem-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nem-loader-card {
  background: #fff;
  padding: 20px 32px;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Brand Gradient & Buttons */
.bg-nem-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.btn-nem {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-weight: 600;
}
.btn-nem:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
}

/* Login Shell (v0.6.5 Enhanced Emerald Glass Banner + Clean Google Button + Single-line Footer) */
.nem-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 20px;
  background:
    radial-gradient(circle at 12% 15%, rgba(16, 185, 129, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(5, 150, 105, 0.14) 0%, transparent 45%),
    linear-gradient(160deg, #f0fdf4 0%, #f8fafc 52%, #ecfdf5 100%);
}
.nem-login-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 22px 54px rgba(5, 150, 105, 0.13), 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(167, 243, 208, 0.85);
  overflow: hidden;
}
.nem-login-hero {
  position: relative;
  padding: 28px 24px 24px;
  background: linear-gradient(135deg, #047857 0%, #059669 48%, #10b981 100%);
  overflow: hidden;
}
.nem-login-hero::before,
.nem-login-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.nem-login-hero::before {
  width: 210px;
  height: 210px;
  top: -85px;
  right: -65px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
}
.nem-login-hero::after {
  width: 170px;
  height: 170px;
  bottom: -75px;
  left: -55px;
  background: radial-gradient(circle, rgba(167, 243, 208, 0.24) 0%, rgba(167, 243, 208, 0) 72%);
}
.nem-login-hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.65;
  pointer-events: none;
}
.nem-login-logo-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  padding: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nem-login-logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nem-login-logo-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.nem-login-pill {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ecfdf5;
}
.btn-google-official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all 0.16s ease;
  cursor: pointer;
}
.btn-google-official:hover {
  background: #f8fafc;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.12);
  transform: translateY(-1px);
}
.btn-google-official:active {
  transform: translateY(0);
}
.nem-login-footer {
  max-width: 780px;
  width: 100%;
  font-size: 0.78rem;
}
@media (min-width: 640px) {
  .nem-login-footer .nem-footer-line {
    white-space: nowrap;
  }
}
.nem-login-tabs .nav-link {
  border: none;
  border-radius: 12px;
  font-weight: 600;
  color: var(--nem-muted);
  padding: 10px 14px;
}
.nem-login-tabs .nav-link.active {
  background: var(--nem-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* Student Portal */
.nem-student-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--nem-border);
  position: sticky;
  top: 0;
  z-index: 1020;
}
.nem-subject-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--nem-border);
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}
.nem-subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}
.nem-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.nem-dot-green { background: #10b981; box-shadow: 0 0 0 4px #d1fae5; }
.nem-dot-yellow { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.nem-dot-red { background: #ef4444; box-shadow: 0 0 0 4px #fee2e2; }
.nem-dot-none { background: #cbd5e1; box-shadow: 0 0 0 4px #f1f5f9; }

/* Admin Desktop Light Mode + Left Sidebar */
.nem-admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.nem-sidebar {
  width: var(--nem-sidebar-w);
  min-width: var(--nem-sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--nem-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.nem-sidebar-brand {
  padding: 18px 16px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}
.nem-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 3px 10px;
  border-radius: 10px;
  color: #334155;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: calc(100% - 20px);
  text-align: left;
  transition: all 0.15s ease;
}
.nem-nav-item:hover {
  background: var(--nem-primary-soft);
  color: var(--nem-primary);
}
.nem-nav-item.active {
  background: var(--nem-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.nem-nav-item i {
  width: 20px;
  text-align: center;
}
.nem-admin-main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  background: var(--nem-bg);
}
.custom-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--nem-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
.nem-kpi-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--nem-border);
  padding: 18px 20px;
}
.table thead th {
  background-color: #ecfdf5;
  color: #065f46;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 2px solid #a7f3d0;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
}
.pin-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .nem-admin-shell { flex-direction: column; }
  .nem-sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--nem-border); }
  .nem-admin-main { padding: 16px; }
}

@media print {
  @page { size: A4 landscape; margin: 8mm 10mm; }
  .no-print, .nem-sidebar, .nem-student-topbar { display: none !important; }
  .nem-admin-main { padding: 0 !important; background: #fff !important; }
}

/* =========================================================================
   OFFICIAL SPLASH PRELOADER (8G-NEM Emerald Theme) & FOOTER
   ========================================================================= */
.nem-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: radial-gradient(circle at center, #ffffff 0%, #f0fdf4 55%, #ecfdf5 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.nem-splash-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.nem-splash-logo-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 35px rgba(5, 150, 105, 0.16), 0 0 0 8px rgba(16, 185, 129, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-bottom: 18px;
}
.nem-splash-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.nem-splash-pill {
  background: #d1fae5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.nem-splash-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d1fae5;
  border-top-color: #059669;
  border-radius: 50%;
  animation: nemSpin 0.85s linear infinite;
  margin: 18px auto 10px;
}
@keyframes nemSpin {
  to { transform: rotate(360deg); }
}

.nem-official-footer {
  text-align: center;
  padding: 18px 12px 12px;
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.65;
}
.nem-official-footer strong {
  color: #065f46;
}

/* =========================================================================
   PHASE 3: DISTRACTION-FREE EXAM ROOM & STUDY PRESCRIPTION
   ========================================================================= */
.nem-exam-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #ffffff;
  border-bottom: 2px solid #d1fae5;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.nem-timer-pill {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 6px 14px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.nem-timer-pill.warning {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
.nem-timer-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  animation: nemPulse 1s infinite;
}
@keyframes nemPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.nem-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}
.nem-choice-card:hover {
  border-color: #6ee7b7;
  background: #f0fdf4;
}
.nem-choice-card.selected {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.12);
}
.nem-choice-letter {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nem-choice-card.selected .nem-choice-letter {
  background: #059669;
  color: #ffffff;
}
.nem-qnav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}
.nem-qnav-btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  position: relative;
}
.nem-qnav-btn.answered {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}
.nem-qnav-btn.flagged {
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.nem-qnav-btn.current {
  outline: 3px solid #2563eb;
  outline-offset: 1px;
}
.nem-prescription-card {
  border-left: 5px solid #ef4444;
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.nem-prescription-card.review {
  border-left-color: #f59e0b;
}

/* Compact Question Row + Hover Choice Popover */
.nem-q-hover-trigger {
  cursor: help;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.nem-q-hover-trigger:hover {
  color: #059669 !important;
}
.popover.nem-choice-popover {
  max-width: 440px;
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
.popover.nem-choice-popover .popover-header {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid #d1fae5;
  border-radius: 14px 14px 0 0;
}
.popover.nem-choice-popover .popover-body {
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 10px 14px;
}

/* Compact Audit Logs Table & Subject Filter Pills */
.table-compact thead th {
  padding: 8px 10px !important;
  font-size: 0.82rem;
}
.table-compact tbody td {
  padding: 5px 10px !important;
  font-size: 0.83rem;
  line-height: 1.35;
}
.nem-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.nem-sub-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nem-sub-pill-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}
/* Subject Pill: Has Exam Sets (>0) */
.nem-sub-pill.has-sets {
  background: #ffffff;
  border-color: var(--sub-color, #10b981);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.nem-sub-pill.has-sets .nem-sub-pill-cnt {
  background: var(--sub-color, #10b981);
  color: #ffffff;
}
.nem-sub-pill.has-sets:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.11);
}
.nem-sub-pill.has-sets.active {
  background: var(--sub-color, #059669);
  border-color: var(--sub-color, #059669);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}
.nem-sub-pill.has-sets.active .nem-sub-pill-dot {
  background: #ffffff !important;
}
.nem-sub-pill.has-sets.active .nem-sub-pill-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
/* Subject Pill: Empty (0 sets) */
.nem-sub-pill.is-empty {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  color: #94a3b8;
  font-weight: 500;
  opacity: 0.82;
}
.nem-sub-pill.is-empty .nem-sub-pill-cnt {
  background: #e2e8f0;
  color: #64748b;
}
.nem-sub-pill.is-empty:hover {
  opacity: 1;
  border-color: #94a3b8;
  color: #475569;
}
.nem-sub-pill.is-empty.active {
  background: #64748b;
  border-style: solid;
  border-color: #64748b;
  color: #ffffff;
  opacity: 1;
}
.nem-sub-pill.is-empty.active .nem-sub-pill-cnt {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
/* All-Subjects Pill */
.nem-sub-pill.pill-all {
  border-color: #10b981;
  color: #047857;
  background: #ecfdf5;
}
.nem-sub-pill.pill-all .nem-sub-pill-cnt {
  background: #059669;
  color: #ffffff;
}
.nem-sub-pill.pill-all.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(5, 150, 105, 0.28);
}
.nem-sub-pill.pill-all.active .nem-sub-pill-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Student Portal 2-Tab Bar, Ready Alert & Prominent Exam Cards (v0.6.7) */
.nem-ready-alert {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}
.nem-ready-alert.all-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  box-shadow: none;
}
.nem-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
  animation: nemLivePulse 1.6s infinite;
}
@keyframes nemLivePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.nem-stu-tabs .nav-link {
  border-radius: 12px;
  font-weight: 700;
  color: #475569;
  padding: 10px 14px;
  font-size: 0.94rem;
  transition: all 0.15s ease;
}
.nem-stu-tabs .nav-link.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.nem-stu-tabs .nav-link.active #stuTabPassedBadge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}
.nem-exam-set-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-left: 5px solid var(--card-accent, #10b981);
  border-radius: 16px;
  padding: 16px 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.nem-exam-set-card.is-ready {
  border-color: #a7f3d0;
  border-left-color: var(--card-accent, #10b981);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.08);
}
.nem-exam-set-card.is-ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.14);
}
.nem-exam-set-card.is-done {
  background: #f8fafc;
}
.nem-subject-card.is-clickable {
  cursor: pointer;
  border-color: #a7f3d0;
}
.nem-subject-card.is-clickable:hover {
  border-color: #10b981;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.14);
  transform: translateY(-2px);
}
.nem-subject-card.is-pending-exam {
  cursor: pointer;
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 60%);
}
.nem-subject-card.is-pending-exam:hover {
  border-color: #f59e0b;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.16);
  transform: translateY(-2px);
}
.nem-exporting-jpg {
  background: #f8fafc !important;
  padding: 20px !important;
  border-radius: 16px;
}
.nem-attempt-row-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nem-attempt-row-card.is-latest {
  border-color: #6ee7b7;
  background: #f0fdf4;
}
.nem-attempt-row-card:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
}

/* =========================================================================
   MOBILE-FIRST RESULT & INTERACTIVE STUDY PRESCRIPTION (v0.6.4)
   ========================================================================= */
.nem-result-accent {
  height: 6px;
  width: 100%;
}
.nem-result-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 8px;
}
.nem-progress-wrap {
  padding-top: 18px;
}
.nem-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
}
.nem-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.nem-pass-marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: #0f172a;
  z-index: 2;
}
.nem-pass-marker-label {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* Accordion Study Prescription */
.nem-pres-acc-item {
  border: 1px solid #e2e8f0;
  border-left: 4px solid #ef4444;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.nem-pres-acc-item.review {
  border-left-color: #f59e0b;
}
.nem-pres-acc-header {
  width: 100%;
  background: #ffffff;
  border: none;
  padding: 13px 14px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.nem-pres-acc-header:hover {
  background: #f8fafc;
}
.nem-pres-acc-chevron {
  color: #64748b;
  transition: transform 0.2s ease;
  margin-top: 3px;
  flex-shrink: 0;
}
.nem-pres-acc-header[aria-expanded="true"] .nem-pres-acc-chevron {
  transform: rotate(180deg);
  color: #059669;
}
.nem-pres-acc-body {
  padding: 4px 14px 14px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}
.nem-pres-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.94rem;
  line-height: 1.45;
  color: #1e293b;
  transition: all 0.15s ease;
  user-select: none;
}
.nem-pres-checklist-item:hover {
  border-color: #6ee7b7;
  background: #f0fdf4;
}
.nem-pres-checklist-item.checked {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #64748b;
}
.nem-pres-checklist-item.checked .nem-pres-topic-text {
  text-decoration: line-through;
}
.nem-pres-checkbox {
  width: 19px;
  height: 19px;
  min-width: 19px;
  margin-top: 2px;
  accent-color: #059669;
  cursor: pointer;
}

/* Segmented Toggle & 8-Subject Bar Rows */
.nem-seg-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
  border: 1px solid #e2e8f0;
}
.nem-seg-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nem-seg-btn.active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.nem-8sub-row {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.nem-8sub-bar-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 6px;
}
.nem-8sub-bar-fill {
  height: 100%;
  border-radius: 999px;
}
.nem-8sub-bar-pass {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #475569;
  opacity: 0.65;
}

@media (max-width: 575.98px) {
  .nem-result-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .nem-pres-checklist-item {
    font-size: 0.92rem;
    padding: 9px 10px;
  }
}


